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

Wednesday, March 28, 2012

How do I recognize dynamic buttons as triggers for updating updatepanels?

I have two updatepanels on a page each with a datagrid inside the panels. I need updatepanel B to update it's datagrid when a LinkButton is clicked inside udatepanel A's datagrid. The linkbuttons are dynamically generated for each row of the datagrid.

Thanks

Braden

Stripped Down Example:

<asp:UpdatePanel id="pnl1" runat="server">
<ContentTemplate>
<asp:datagrid id="dgA" runat="server" > ... <asp:LinkButton ID="lbtnSelect" CommandArgument=' ... ' runat="server">...</asp:LinkButton> ... </asp:datagrid>
</ContentTemplate>
</asp:UpdatePanel>

<!-- Next Panel -->

<asp:UpdatePanel id="pnl2" runat="server">
<ContentTemplate>
<asp:datagrid id="dgB" runat="server" > ... </asp:datagrid>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbtnSelect" EventName=" ... "/>
</Triggers>
</asp:UpdatePanel>

Unless I misread your post, I think that all you need to do is add the following line inside of your event handler for the link buttons (lbtnSelect_Click, or similar):

pnl2.update();

This should update your pnl1 because the linkbutton's click event fired inside of pnl1, andprogrammatically updating pnl2 with pnl2.update() should take care of updating the other datagrid (dgB). You can get rid of the <Triggers> definition too.

Monday, March 26, 2012

How do I extend a DataGrid/DataList for ATLAS behavior?

I have two inherited DataGrid and DataList classes that render a paged grid and list with some enhanced behaviors (better pagers and retreiving only items that are shown with NHibernate). I would like paging not to refresh the page.

It's easy with an UpdatePanel: add a panel, add an event OnDataBinding( ) and Update the panel. For my project (www.foodcandy.com) this means updating a hundred grids and lists.

So instead I would like to build the panel behavior into the actual DataGrid and DataList and have all my grids behave this way. The first easy thing is to add a panel property and tell the grid/list that it's inside an update panel. But I still have to modify a 100 pages to add the update panels.

How do I do something like that?

Thx
dB.

hello.

maybe building a usercontrol will be the faster way to get what you want...though i still think that i'd add the panel to all the pages..


I doubt it will be faster Luis - this is a datagrid, I would need to expose all the methods for various properties like PagerStyle and I am not even sure what to do with ItemTemplates. No?

hello.

well, i was thinking in adding a property to the usercontrol that lets you get a reference to the datagrid.


Luis Abreu:

well, i was thinking in adding a property to the usercontrol that lets you get a reference to the datagrid.

I haven't tried this, but can you nest this in the aspx pages by having MyUserControl expose the DataGrid member?

<MyUserControl>
<DataGrid>
<TemplateColumn ... />
</DataGrid>
<MyUserControl>

Saturday, March 24, 2012

How Datagrid rows items drag and drop into another datagrid footer template ....

Hi all...

I am using ATLAS + ASP.NET + C#... i have a requirement like, i wants to drag an datagrid item from one column... and drops into another datagrid footer control. i am new to Atlas technology...Please help me, if anybody have the ATLAS information to learn more abt ATLAS please send me to thisbasavareddygopsen@dotnet.itags.org.rediffmail.com...

Regards,

Basawareddy

HI,

i am sorry dont have a reply to your query, but will surely work out to find it out. But i too have a query, i hope u might be able to help me out.

I am also using ATLAS + ASP.NET+ C#...for developing on of the web based applications. The issue that we are facing right now is that we are not able to get pop up error messages when we are using Atlas, can you help me out to educate me that is it possible to integrate pop up error messages while using Atlas, if YES then please let me know how...

Thanks a lotSmile

Prakhar Saxena