Showing posts with label datagrid. Show all posts
Showing posts with label datagrid. Show all posts

Wednesday, March 28, 2012

UpdateProgress panel positioning

I have a page that has a datagrid that can be quite long. I don't want to page it so a user sometimes scrolls down and then clicks a button in the grid.

The issue is that the updateprogress image is up at the top of the page and if a user scrolls and then clicks in the grid they don't see the progress image because it is up top.

Is there a way to put the updateprogress panel where the user clicked instead of up top in a set position all the time?

Hi,

You can set the position of the updateprogress image via javascript according to the button's position.

Thanks

Monday, March 26, 2012

Updating DataGrid control with ajax

Hi,

First post here (hope it's in the right forum)-go easy on me-I'm new to ajax!

Okay, so I have a control, which populates a datagrid, given two values (from seperate controls). Basically I want to make it so that pressing the update button will reload just the function that fills the datagrid and not the whole page, if you see what I mean.

I think I need to be using an update panel but the server side end is confusing me.

Thanks

The easiest way is going to be, put your Datagrid (I think you mean gridview) and your button inside an update panel.

Wire the buttons onclick event up to to just redatabind the grid. Here's an example: This example uses an unbound gridview, because I dont have any data currently to bind one too, but you'rs would be bound and work the same.

 <asp:UpdatePanel ID="update1" runat="server" UpdateMode="conditional" ChildrenAsTriggers="true"> <ContentTemplate> <asp:GridView ID="gv1" runat="server"> </asp:GridView> <asp:Button ID="button1" runat="server" Text="Update Grid" OnClick="button1_Click" /> </ContentTemplate> </asp:UpdatePanel>

Protected Sub button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs) gv1.DataBind()End Sub
Give it a shot, if you run into problems, post back and let us know, we can help you further.


Sorry I havent replied sooner, I've been having problems populating my gridview. I'll come back and look at it once I have the function that takes the two values and returns the dataset :)

updating datagrid view

Hi,

I am new to ajax,Can anyone help me with updating the gridview on clicking hyperlingk in one of its templatecolumn.

Itechs

Hi Itechs,

Just place the gridview in an updatepanel, and disable the callbackoptions of the gridview.

Then you should have a gridview with ajax fuctionallity (=no full page refreshes).

If you have questions/remarks please do so!

Kind regards,
Wim