Update panel with Gridview control using blank values in textbox

  • Thread starter Alex. O. Koranteng
  • Start date
A

Alex. O. Koranteng

Steve Cheng

I am attempting to continue using your code suggestions and having a hard
time. How do I toggle the visibility of the two panels. I will send you a
zipped file of my latest version for help. Check your email shortly

Thanks
 
S

Steven Cheng

Thanks for your posting Alex,

Sure, please let me know when you've sent me the package so that I can
check it.

BTW, have you also tried another suggestion(using a modified SQL statement
and add an additional query parameter)? I think it is also working well for
your case.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
--------------------
 
A

Alex. O. Koranteng

Hi Steve,

I emailed to you a zipped package to take a look at.

Thanks
 
S

Steven Cheng

Hi Alex,

It seems I haven't received your new email, would you please double check?
Maybe it is blocked due to large size?

BTW, is it convenient that you provide a FTP address for me to download the
package? thus, it would be much more convenient and also afford large size
package.

Looking forward to your reply.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

--------------------
From: =?Utf-8?B?QWxleC4gTy4gS29yYW50ZW5n?= <[email protected]>
References: <[email protected]>
 
A

Alex. O. Koranteng

Steve,

I just emailed you my latest working version of the solution project. It
went to your (e-mail address removed) address. Sorry for the delay.
 
S

Steven Cheng

Hi Alex,

I've checked the project you attached. It seems the "Triggerswithpanels"
page has many problems(lack of event handler code and some datasource
parameters are not configured correctly. I've created two new
pages(NewTriggers.aspx and NewTriggers1.aspx) which contains two solutions
for your case(to display all records whenever there is no match records or
if the user doesn't input any text). I've attached the two pages in the
email I sent you.

NewTriggers.aspx simply use GridView's "EmptyDataTemplate" and
NewTriggers1.aspx use a customized sql query statement to achieve the
similar result.

Regards,

Steven

--------------------
From: =?Utf-8?B?QWxleC4gTy4gS29yYW50ZW5n?= <[email protected]>
References: <[email protected]>
<[email protected]>
 
S

Steven Cheng

Hi Alex,

I have tested the project. It seems for the "NewTrigger.aspx", you haven't
specify paging setting for the Inner GridView (inside <EmptyDataTemplate>
). It is a separate GridView from the outer main gridview. Therefore, you
also need to specify paging parameters for it. You can change the template
as below:

==================================
&nbsp;<asp:GridView id="gvOrderDetails" runat="server"
DataSourceID="sqldsOrderDetails" AllowSorting="true"
Width="95%"
AllowPaging="True" PageSize="2" >
<AlternatingRowStyle BackColor="AliceBlue" />
<HeaderStyle HorizontalAlign="Left" />

<EmptyDataTemplate>
<asp:SqlDataSource
ID="sqldsAllOrderDetails" runat="server"
SelectCommand="select * from dbo.[order details]"
SelectCommandType="Text"
ConnectionString="<%$
ConnectionStrings:NorthwindConnectionString %>"
/>

<asp:GridView id="gvAllOrderDetails" runat="server"
DataSourceID="sqldsAllOrderDetails" AllowSorting="true" Width="95%"
AllowPaging="true" PageSize="3" >
<AlternatingRowStyle BackColor="aliceBlue" />
<HeaderStyle HorizontalAlign="Left" />
</asp:GridView>

</EmptyDataTemplate>
<PagerSettings Position="TopAndBottom" />
<PagerStyle BackColor="DarkTurquoise" />
</asp:GridView>

=========================


Regards,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).


--------------------
 
S

Steven Cheng

Hi Alex,

Any progress on this or do you still have anything unclear?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
--------------------
From: (e-mail address removed) ("Steven Cheng")
Organization: Microsoft
Date: Mon, 09 Feb 2009 13:37:48 GMT
Subject: RE: Update panel with Gridview control using blank values in textb
Hi Alex,

I have tested the project. It seems for the "NewTrigger.aspx", you haven't
specify paging setting for the Inner GridView (inside <EmptyDataTemplate>
). It is a separate GridView from the outer main gridview. Therefore, you
also need to specify paging parameters for it. You can change the template
as below:

==================================
&nbsp;<asp:GridView id="gvOrderDetails" runat="server"
DataSourceID="sqldsOrderDetails" AllowSorting="true"
Width="95%"
AllowPaging="True" PageSize="2" >
<AlternatingRowStyle BackColor="AliceBlue" />
<HeaderStyle HorizontalAlign="Left" />

<EmptyDataTemplate>
<asp:SqlDataSource
ID="sqldsAllOrderDetails" runat="server"
SelectCommand="select * from dbo.[order details]"
SelectCommandType="Text"
ConnectionString="<%$
ConnectionStrings:NorthwindConnectionString %>"
/>

<asp:GridView id="gvAllOrderDetails" runat="server"
DataSourceID="sqldsAllOrderDetails" AllowSorting="true" Width="95%"
AllowPaging="true" PageSize="3" >
<AlternatingRowStyle BackColor="aliceBlue" />
<HeaderStyle HorizontalAlign="Left" />
</asp:GridView>

</EmptyDataTemplate>
<PagerSettings Position="TopAndBottom" />
<PagerStyle BackColor="DarkTurquoise" />
</asp:GridView>

=========================


Regards,
 
S

Steven Cheng

Hi Alex,

As for the another GridView, it is inside <EmptyDataTemplate>. I've bold
the two gridviews below:

&nbsp;<asp:GridView id="gvOrderDetails" runat="server"
DataSourceID="sqldsOrderDetails" AllowSorting="true"
Width="95%"
AllowPaging="True" PageSize="2" >
<AlternatingRowStyle BackColor="AliceBlue" />
<HeaderStyle HorizontalAlign="Left" />

<EmptyDataTemplate>
.........................
<asp:GridView id="gvAllOrderDetails" runat="server"
DataSourceID="sqldsAllOrderDetails" AllowSorting="true" Width="95%"
AllowPaging="true" PageSize="3" >
<AlternatingRowStyle BackColor="aliceBlue" />
.....................

For the EmptyDataTemplate, it is just a new property introduced for some
template databound control in ASP.NET 2.0, you can get more info in the
MSDN document:

#GridView..::.EmptyDataTemplate Property
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.e
mptydatatemplate.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top