PC Review


Reply
Thread Tools Rate Thread

Binding to a bound grid

 
 
MattC
Guest
Posts: n/a
 
      16th Feb 2005
Hi,

This question is in relation to a System.Web.UI.DataGrid

If I bind some data to a grid, then in a subsequent postback bind to it
again, does the grid intrincially clear its contents before adding the new
information.

TIA


 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      16th Feb 2005
Hi Matt,

When postback, the datagrid losses its underlying data
source already. If you want to show the datagrid again,
you have to rebind its data source.

HTH,

Elton Wang
(E-Mail Removed)

>-----Original Message-----
>Hi,
>
>This question is in relation to a System.Web.UI.DataGrid
>
>If I bind some data to a grid, then in a subsequent

postback bind to it
>again, does the grid intrincially clear its contents

before adding the new
>information.
>
>TIA
>
>
>.
>

 
Reply With Quote
 
intrader
Guest
Posts: n/a
 
      17th Feb 2005
On Wed, 16 Feb 2005 13:41:34 -0800, Elton Wang wrote:

> Hi Matt,
>
> When postback, the datagrid losses its underlying data
> source already. If you want to show the datagrid again,
> you have to rebind its data source.
>
> HTH,
>
> Elton Wang
> (E-Mail Removed)
>
>>-----Original Message-----
>>Hi,
>>
>>This question is in relation to a System.Web.UI.DataGrid
>>
>>If I bind some data to a grid, then in a subsequent

> postback bind to it
>>again, does the grid intrincially clear its contents

> before adding the new
>>information.
>>
>>TIA
>>
>>
>>.
>>

Even when ViewState is enabled (not that I recommend that viewstat is
enabled for grids).

 
Reply With Quote
 
Elton Wang
Guest
Posts: n/a
 
      17th Feb 2005
You are right. I forgot the simplest thing. When ViewState
is enabled, after postback, if the datagrid keeps all
things unchanged, it can be shown without rebinding data
source. But if something changes, not even its data, it
can't be shown without rebinding data source.

We all know the datagrid is much more complicated than
many other web server controls. It has many
functionalities, such as paging, sorting, in-line editing,
and so on. In term of ViewState of the datagrid, I
personally think it's better to enable it. Although it
has better performance with disabled ViewState, it might
also disable some functionalities.

Elton Wang

>-----Original Message-----
>On Wed, 16 Feb 2005 13:41:34 -0800, Elton Wang wrote:
>
>> Hi Matt,
>>
>> When postback, the datagrid losses its underlying data
>> source already. If you want to show the datagrid again,
>> you have to rebind its data source.
>>
>> HTH,
>>
>> Elton Wang
>> (E-Mail Removed)
>>
>>>-----Original Message-----
>>>Hi,
>>>
>>>This question is in relation to a System.Web.UI.DataGrid
>>>
>>>If I bind some data to a grid, then in a subsequent

>> postback bind to it
>>>again, does the grid intrincially clear its contents

>> before adding the new
>>>information.
>>>
>>>TIA
>>>
>>>
>>>.
>>>

>Even when ViewState is enabled (not that I recommend that

viewstat is
>enabled for grids).
>
>.
>

 
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
How add column to IEnumerable or grid it's bound to? Ronald S. Cook Microsoft C# .NET 1 24th Jun 2008 02:49 AM
Get object from List bound to Grid Microsoft Microsoft ASP .NET 0 7th May 2007 05:55 PM
Bound Grid Control Vlad Microsoft Access Form Coding 5 20th Mar 2006 09:16 AM
Looking for the ErrorProvider a grid uses when bound to IBindingLi =?Utf-8?B?TWljaGFlbCBPcGVs?= Microsoft Dot NET Framework Forms 1 4th Oct 2004 03:03 PM
Update a dataset bound to a grid =?Utf-8?B?R2VyYWxkaW5lIEhvYmxleQ==?= Microsoft VB .NET 3 28th Jan 2004 03:14 PM


Features
 

Advertising
 

Newsgroups
 


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