Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Datagrid Control (http://www.velocityreviews.com/forums/f60-asp-net-datagrid-control.html)
-   -   Removing columns from Gridview(2.0) databinding on templatefileds dont work? (http://www.velocityreviews.com/forums/t762682-removing-columns-from-gridview-2-0-databinding-on-templatefileds-dont-work.html)

Maarten 04-02-2006 01:51 PM

Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
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



Christopher Reed 04-02-2006 02:18 PM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
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" <Patatm@mayo.com> wrote in message
news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
> 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
>




Pipo 04-03-2006 07:04 AM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
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" <carttu@nospam.nospam> wrote in message
news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
> 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" <Patatm@mayo.com> wrote in message
> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>> 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
>>

>
>




Christopher Reed 04-04-2006 02:47 AM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
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" <PatatM@Mayo.com> wrote in message
news:eu3as0uVGHA.4864@TK2MSFTNGP12.phx.gbl...
> 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" <carttu@nospam.nospam> wrote in message
> news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
>> 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" <Patatm@mayo.com> wrote in message
>> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>>> 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
>>>

>>
>>

>
>




Pipo 04-04-2006 08:54 AM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
No, I am not doing that. It's already databound in design time(see OP)
It is bound through a ObjectDataSources.



"Christopher Reed" <carttu@nospam.nospam> wrote in message
news:OFwvhJ5VGHA.1160@TK2MSFTNGP09.phx.gbl...
> 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" <PatatM@Mayo.com> wrote in message
> news:eu3as0uVGHA.4864@TK2MSFTNGP12.phx.gbl...
>> 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" <carttu@nospam.nospam> wrote in message
>> news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
>>> 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" <Patatm@mayo.com> wrote in message
>>> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>>>> 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
>>>>
>>>
>>>

>>
>>

>
>




Christopher Reed 04-04-2006 11:55 AM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
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" <PatatM@Mayo.com> wrote in message
news:emzXqV8VGHA.5076@TK2MSFTNGP14.phx.gbl...
> No, I am not doing that. It's already databound in design time(see OP)
> It is bound through a ObjectDataSources.
>
>
>
> "Christopher Reed" <carttu@nospam.nospam> wrote in message
> news:OFwvhJ5VGHA.1160@TK2MSFTNGP09.phx.gbl...
>> 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" <PatatM@Mayo.com> wrote in message
>> news:eu3as0uVGHA.4864@TK2MSFTNGP12.phx.gbl...
>>> 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" <carttu@nospam.nospam> wrote in message
>>> news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
>>>> 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" <Patatm@mayo.com> wrote in message
>>>> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>>>>> 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
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>




Pipo 04-05-2006 01:15 PM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
I will try that, thank you!


"Christopher Reed" <carttu@nospam.nospam> wrote in message
news:%235oRf79VGHA.5288@TK2MSFTNGP14.phx.gbl...
> 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" <PatatM@Mayo.com> wrote in message
> news:emzXqV8VGHA.5076@TK2MSFTNGP14.phx.gbl...
>> No, I am not doing that. It's already databound in design time(see OP)
>> It is bound through a ObjectDataSources.
>>
>>
>>
>> "Christopher Reed" <carttu@nospam.nospam> wrote in message
>> news:OFwvhJ5VGHA.1160@TK2MSFTNGP09.phx.gbl...
>>> 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" <PatatM@Mayo.com> wrote in message
>>> news:eu3as0uVGHA.4864@TK2MSFTNGP12.phx.gbl...
>>>> 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" <carttu@nospam.nospam> wrote in message
>>>> news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
>>>>> 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" <Patatm@mayo.com> wrote in message
>>>>> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>>>>>> 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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>




Pipo 04-06-2006 07:16 AM

Re: Removing columns from Gridview(2.0) databinding on templatefileds dont work?
 
Nope, not working either



"Pipo" <PatatM@Mayo.com> wrote in message
news:uyqrDMLWGHA.404@TK2MSFTNGP05.phx.gbl...
>I will try that, thank you!
>
>
> "Christopher Reed" <carttu@nospam.nospam> wrote in message
> news:%235oRf79VGHA.5288@TK2MSFTNGP14.phx.gbl...
>> 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" <PatatM@Mayo.com> wrote in message
>> news:emzXqV8VGHA.5076@TK2MSFTNGP14.phx.gbl...
>>> No, I am not doing that. It's already databound in design time(see OP)
>>> It is bound through a ObjectDataSources.
>>>
>>>
>>>
>>> "Christopher Reed" <carttu@nospam.nospam> wrote in message
>>> news:OFwvhJ5VGHA.1160@TK2MSFTNGP09.phx.gbl...
>>>> 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" <PatatM@Mayo.com> wrote in message
>>>> news:eu3as0uVGHA.4864@TK2MSFTNGP12.phx.gbl...
>>>>> 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" <carttu@nospam.nospam> wrote in message
>>>>> news:eVsMdCmVGHA.4952@TK2MSFTNGP09.phx.gbl...
>>>>>> 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" <Patatm@mayo.com> wrote in message
>>>>>> news:uH0SfylVGHA.1572@tk2msftngp13.phx.gbl...
>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>





All times are GMT. The time now is 02:35 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.