Showing posts with label grid. Show all posts
Showing posts with label grid. Show all posts

Wednesday, March 28, 2012

How do I show postback search results on a Modal Popup?

My goal is to show the serach results in a grid view on a model popup after the user enters the search criteria on a page and presses the search button. The OnClick event handler needs to collect the search criteria, get the dataset after querying the database and bind the data to the gridview before displaying the modal popup.

My problem is that the search button's id can't be assigned to the TargetControlID of the ModalPopupProperties as it will not let the OnClick event be fired and process the postback.

Please suggest the solution/workaround.

Thanks much

Display the ModalPopup via script instead?

David,

Do you have an example or a sample of the script that I can take a look at?

The other option would be to dynamically create the popup, after I process my search funcationility. But the question is, how do I invoke the display of the popup after associating the TargetID of the search button to the dynamically created ModelPopup?

Thanks for looking into it.

Vijay


I believe the following post outlines how to display the ModalPopup with script:http://forums.asp.net/thread/1280980.aspx

Monday, March 26, 2012

How do I get the CalendarExtender to show Gridview Templete Field

Hi

i want to use Calendar Extender Control in My grid view's temple field how can i use that calendar control

Code (calendar extender is associated with End Date):

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Employee Id,Start Date" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Employee Id" HeaderText="Employee Id" ReadOnly="True" SortExpression="Employee Id" />
<asp:TemplateField HeaderText="Start Date" SortExpression="Start Date">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("[Start Date]") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("[Start Date]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="End Date" SortExpression="End Date">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("[End Date]") %>'></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="Textbox1">
</cc1:CalendarExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("[End Date]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

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 could i put a javascript window.open into a select button of a grid which is into a up

Thanks in advance.You need to insert the Javascript in the sript manager for the Ajax Page