469,648 Members | 1,137 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

DataGrid Refersh to remove previous data. remove current selection

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
Jul 21 '05 #1
0 1075

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chris Plowman | last post: by
2 posts views Thread by pei_world | last post: by
reply views Thread by MrNobody | last post: by
1 post views Thread by Vijay Kerji | last post: by
3 posts views Thread by Lars Netzel | last post: by
3 posts views Thread by kingflux | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.