Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Removing columns from Gridview(2.0) databinding on templatefileds dont work?

Reply
Thread Tools

Removing columns from Gridview(2.0) databinding on templatefileds dont work?

 
 
Maarten
Guest
Posts: n/a
 
      04-02-2006
Hi,

I have a gridview (2.0), in the page load I remove a couple of columns from
the gridview which I dont need.
(All the columns are databound)
This works fine. But after a postback all the templatefields are not bind
anymore.
Only the boundfields are still bound.
Why? and what can I do about this?


Many thanks,

Page_Load:

If Not IsPostBack Then

'Loop to remove the extra columns we dont need:

end if


 
Reply With Quote
 
 
 
 
Christopher Reed
Guest
Posts: n/a
 
      04-02-2006
If you don't need them, remove from the design. This may actually help
resolve your main issue.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Maarten" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a gridview (2.0), in the page load I remove a couple of columns
> from the gridview which I dont need.
> (All the columns are databound)
> This works fine. But after a postback all the templatefields are not bind
> anymore.
> Only the boundfields are still bound.
> Why? and what can I do about this?
>
>
> Many thanks,
>
> Page_Load:
>
> If Not IsPostBack Then
>
> 'Loop to remove the extra columns we dont need:
>
> end if
>



 
Reply With Quote
 
 
 
 
Pipo
Guest
Posts: n/a
 
      04-03-2006
Hi Christopher,

I understand that, but that's no option.
I only know which one to remove at run-time, due to user selection.
And not at design-time!




"Christopher Reed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you don't need them, remove from the design. This may actually help
> resolve your main issue.
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
>
> "Maarten" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>>
>> I have a gridview (2.0), in the page load I remove a couple of columns
>> from the gridview which I dont need.
>> (All the columns are databound)
>> This works fine. But after a postback all the templatefields are not bind
>> anymore.
>> Only the boundfields are still bound.
>> Why? and what can I do about this?
>>
>>
>> Many thanks,
>>
>> Page_Load:
>>
>> If Not IsPostBack Then
>>
>> 'Loop to remove the extra columns we dont need:
>>
>> end if
>>

>
>



 
Reply With Quote
 
Christopher Reed
Guest
Posts: n/a
 
      04-04-2006
Then, are you building your GridView in the Page_Load? If so, make sure the
call to the DataBind method is not inside the If (!IsPostBack) clause.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Pipo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Christopher,
>
> I understand that, but that's no option.
> I only know which one to remove at run-time, due to user selection.
> And not at design-time!
>
>
>
>
> "Christopher Reed" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> If you don't need them, remove from the design. This may actually help
>> resolve your main issue.
>> --
>> Christopher A. Reed
>> "The oxen are slow, but the earth is patient."
>>
>> "Maarten" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi,
>>>
>>> I have a gridview (2.0), in the page load I remove a couple of columns
>>> from the gridview which I dont need.
>>> (All the columns are databound)
>>> This works fine. But after a postback all the templatefields are not
>>> bind anymore.
>>> Only the boundfields are still bound.
>>> Why? and what can I do about this?
>>>
>>>
>>> Many thanks,
>>>
>>> Page_Load:
>>>
>>> If Not IsPostBack Then
>>>
>>> 'Loop to remove the extra columns we dont need:
>>>
>>> end if
>>>

>>
>>

>
>



 
Reply With Quote
 
Pipo
Guest
Posts: n/a
 
      04-04-2006
No, I am not doing that. It's already databound in design time(see OP)
It is bound through a ObjectDataSources.



"Christopher Reed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Then, are you building your GridView in the Page_Load? If so, make sure
> the call to the DataBind method is not inside the If (!IsPostBack) clause.
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
>
> "Pipo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi Christopher,
>>
>> I understand that, but that's no option.
>> I only know which one to remove at run-time, due to user selection.
>> And not at design-time!
>>
>>
>>
>>
>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> If you don't need them, remove from the design. This may actually help
>>> resolve your main issue.
>>> --
>>> Christopher A. Reed
>>> "The oxen are slow, but the earth is patient."
>>>
>>> "Maarten" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hi,
>>>>
>>>> I have a gridview (2.0), in the page load I remove a couple of columns
>>>> from the gridview which I dont need.
>>>> (All the columns are databound)
>>>> This works fine. But after a postback all the templatefields are not
>>>> bind anymore.
>>>> Only the boundfields are still bound.
>>>> Why? and what can I do about this?
>>>>
>>>>
>>>> Many thanks,
>>>>
>>>> Page_Load:
>>>>
>>>> If Not IsPostBack Then
>>>>
>>>> 'Loop to remove the extra columns we dont need:
>>>>
>>>> end if
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Christopher Reed
Guest
Posts: n/a
 
      04-04-2006
Then, anytime you make a change to the GridView, you have to DataBind it
again.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Pipo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> No, I am not doing that. It's already databound in design time(see OP)
> It is bound through a ObjectDataSources.
>
>
>
> "Christopher Reed" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Then, are you building your GridView in the Page_Load? If so, make sure
>> the call to the DataBind method is not inside the If (!IsPostBack)
>> clause.
>> --
>> Christopher A. Reed
>> "The oxen are slow, but the earth is patient."
>>
>> "Pipo" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi Christopher,
>>>
>>> I understand that, but that's no option.
>>> I only know which one to remove at run-time, due to user selection.
>>> And not at design-time!
>>>
>>>
>>>
>>>
>>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> If you don't need them, remove from the design. This may actually help
>>>> resolve your main issue.
>>>> --
>>>> Christopher A. Reed
>>>> "The oxen are slow, but the earth is patient."
>>>>
>>>> "Maarten" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Hi,
>>>>>
>>>>> I have a gridview (2.0), in the page load I remove a couple of columns
>>>>> from the gridview which I dont need.
>>>>> (All the columns are databound)
>>>>> This works fine. But after a postback all the templatefields are not
>>>>> bind anymore.
>>>>> Only the boundfields are still bound.
>>>>> Why? and what can I do about this?
>>>>>
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Page_Load:
>>>>>
>>>>> If Not IsPostBack Then
>>>>>
>>>>> 'Loop to remove the extra columns we dont need:
>>>>>
>>>>> end if
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Pipo
Guest
Posts: n/a
 
      04-05-2006
I will try that, thank you!


"Christopher Reed" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Then, anytime you make a change to the GridView, you have to DataBind it
> again.
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
>
> "Pipo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> No, I am not doing that. It's already databound in design time(see OP)
>> It is bound through a ObjectDataSources.
>>
>>
>>
>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Then, are you building your GridView in the Page_Load? If so, make sure
>>> the call to the DataBind method is not inside the If (!IsPostBack)
>>> clause.
>>> --
>>> Christopher A. Reed
>>> "The oxen are slow, but the earth is patient."
>>>
>>> "Pipo" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hi Christopher,
>>>>
>>>> I understand that, but that's no option.
>>>> I only know which one to remove at run-time, due to user selection.
>>>> And not at design-time!
>>>>
>>>>
>>>>
>>>>
>>>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> If you don't need them, remove from the design. This may actually
>>>>> help resolve your main issue.
>>>>> --
>>>>> Christopher A. Reed
>>>>> "The oxen are slow, but the earth is patient."
>>>>>
>>>>> "Maarten" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> Hi,
>>>>>>
>>>>>> I have a gridview (2.0), in the page load I remove a couple of
>>>>>> columns from the gridview which I dont need.
>>>>>> (All the columns are databound)
>>>>>> This works fine. But after a postback all the templatefields are not
>>>>>> bind anymore.
>>>>>> Only the boundfields are still bound.
>>>>>> Why? and what can I do about this?
>>>>>>
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Page_Load:
>>>>>>
>>>>>> If Not IsPostBack Then
>>>>>>
>>>>>> 'Loop to remove the extra columns we dont need:
>>>>>>
>>>>>> end if
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Pipo
Guest
Posts: n/a
 
      04-06-2006
Nope, not working either



"Pipo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I will try that, thank you!
>
>
> "Christopher Reed" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Then, anytime you make a change to the GridView, you have to DataBind it
>> again.
>> --
>> Christopher A. Reed
>> "The oxen are slow, but the earth is patient."
>>
>> "Pipo" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> No, I am not doing that. It's already databound in design time(see OP)
>>> It is bound through a ObjectDataSources.
>>>
>>>
>>>
>>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Then, are you building your GridView in the Page_Load? If so, make
>>>> sure the call to the DataBind method is not inside the If (!IsPostBack)
>>>> clause.
>>>> --
>>>> Christopher A. Reed
>>>> "The oxen are slow, but the earth is patient."
>>>>
>>>> "Pipo" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Hi Christopher,
>>>>>
>>>>> I understand that, but that's no option.
>>>>> I only know which one to remove at run-time, due to user selection.
>>>>> And not at design-time!
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> "Christopher Reed" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> If you don't need them, remove from the design. This may actually
>>>>>> help resolve your main issue.
>>>>>> --
>>>>>> Christopher A. Reed
>>>>>> "The oxen are slow, but the earth is patient."
>>>>>>
>>>>>> "Maarten" <(E-Mail Removed)> wrote in message
>>>>>> news:(E-Mail Removed)...
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have a gridview (2.0), in the page load I remove a couple of
>>>>>>> columns from the gridview which I dont need.
>>>>>>> (All the columns are databound)
>>>>>>> This works fine. But after a postback all the templatefields are not
>>>>>>> bind anymore.
>>>>>>> Only the boundfields are still bound.
>>>>>>> Why? and what can I do about this?
>>>>>>>
>>>>>>>
>>>>>>> Many thanks,
>>>>>>>
>>>>>>> Page_Load:
>>>>>>>
>>>>>>> If Not IsPostBack Then
>>>>>>>
>>>>>>> 'Loop to remove the extra columns we dont need:
>>>>>>>
>>>>>>> end if
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Databinding expressions are only supported on objects that have a DataBinding event jobs ASP .Net 0 09-25-2007 11:54 PM
Gridview encoding, or how to run commands before gridview's default databinding, or, how do I disable default databinding at all? Sergei Shelukhin ASP .Net 1 11-12-2006 01:43 PM
Removing columns from Gridview(2.0) databinding on templatefileds dont work? Maarten ASP .Net Datagrid Control 7 04-06-2006 07:16 AM
Removing columns from Gridview(2.0) databinding on templatefileds dont work? Maarten ASP .Net Web Controls 7 04-06-2006 07:16 AM
DataGrid Custom Column Error when DataBinding "does not contain a definition for 'DataBinding'" Earl Teigrob ASP .Net Datagrid Control 1 03-01-2004 04:52 AM



Advertisments