PC Review


Reply
Thread Tools Rate Thread

DataGrid Refersh to remove previous data. remove current selection

 
 
Jawahar Rajan
Guest
Posts: n/a
 
      17th Feb 2004
All,
I have a datagrid that I use in a ASP.net web page that loads customer data
based on the selected customer ID
Some Customers will have no data in the database (which is oracle 9.2) . So
I check the .HasRows property first then if it is false I skip the data bind
like so

If OraReader.HasRows Then
grdCustomerDetails.AutoGenerateColumns = False
grdCustomerDetails.DataSource = OraReader
grdCustomerDetails.DataBind()

Else
grdCustomerDetails.DataBind()
End If
OraReader = nothing

The reason I do the check rows is to avoid the row headers from being
populated in the grid when there is no data.
If I do not do the .DataBind() in the else portion of the If statement then
the previous data is still present and a user may be confused as the may
think the data belongs to the current customer (who in fact has no data.)

The other question I have involves the currently selected record.
When a user selects a record within the Grid then some processing is done on
the record and the page is posted back. when the page is posted back can I
"deselect" the record. i.e. have nothing selected in the grid after a post
back

All suggestions and ideas are appreciated.

Thanks
Jawahar


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WinXP Pro - I am not able to remove software using Add/Remove programs (Change/Remove Button is not available) Arumugam - winXP - help & Support Windows XP Help 1 18th Feb 2006 03:27 AM
remove hiddens files should read remove hidden data. rhdtool.exe =?Utf-8?B?a2V0Y2g=?= Microsoft Word Document Management 2 23rd Dec 2004 07:12 PM
does sp2 remove previous hotfixes? dmac Windows XP Setup 6 16th Aug 2004 12:07 AM
Automatic Refersh the Datagrid with the timer class in System.Threading Montaque Microsoft C# .NET 1 21st Feb 2004 08:38 PM
Remove Previous Changes Dave Microsoft Word Document Management 1 22nd Jan 2004 04:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:06 AM.