GridView and hidden field - DOTNET

This is a discussion on GridView and hidden field - DOTNET ; i have a GridView and a hidden field : <asp:TemplateField Visible=false > <ItemTemplate > <asp:HiddenField Value="<%#Eval("isActive")%>" id="hidIsActive" runat=server /> </ItemTemplate> </asp:TemplateField> 1)when i check the sorce of html i dont see the hidden field - why is that? 2)on RowDataBound ...

+ Reply to Thread
Results 1 to 9 of 9

GridView and hidden field

  1. Default GridView and hidden field

    i have a GridView and a hidden field :
    <asp:TemplateField Visible=false >
    <ItemTemplate >
    <asp:HiddenField Value="<%#Eval("isActive")%>"
    id="hidIsActive" runat=server />
    </ItemTemplate>
    </asp:TemplateField>
    1)when i check the sorce of html i dont see the hidden field - why is that?
    2)on RowDataBound event, when i check the rows i want to check thr above
    field value,and to do something on certin conditions.
    the thing is that its value is set in a "Value" property while i try to
    access using :
    e.Row.Cells(5).Text
    i wont get anything beacuse i access the wrong properrty
    what can i do?
    thnaks in advance
    Peleg

  2. Default Re: GridView and hidden field

    On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > i have a GridView and a hidden field :
    > <asp:TemplateField Visible=false >
    > <ItemTemplate >
    > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > id="hidIsActive" runat=server />
    > </ItemTemplate>
    > </asp:TemplateField>
    > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > 2)on RowDataBound event, when i check the rows i want to check thr above
    > field value,and to do something on certin conditions.
    > the thing is that its value is set in a "Value" property while i try to
    > access using :
    > e.Row.Cells(5).Text
    > i wont get anything beacuse i access the wrong properrty
    > what can i do?
    > thnaks in advance
    > Peleg


    Hi...

    "1)when i check the sorce of html i dont see the hidden field - why is
    that?"
    hi id you set any controls property to visible=false... asp.net does
    not render them in client page....
    i am not sure wheither hidden value also do that or not...
    you can use html hidden input field to test that... (ofcourse with
    runat server attribute)

    i can see that you are using hidden field... but is that necessary?
    what is "isActive"? doesn't seems to me it is coming from any
    dataitem.. ratherthan page property...
    if you want to perform any job depending on a cell value of the
    dataitem... you should do in rowdatabound.. as i can see that you are
    already doing that... so next thing is after accomplish your job...
    you what to do some business on, lets say rowcommand... or
    itemcommand,, in that case i assume you want to save the value
    "IsActive" with the row...

    well you can use e.row.attribute.add.... to add some attribute value
    in itemdataboud...
    and then retrive in row command....

    Thanks
    Md. Masudur Rahman (Munna)
    kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com


  3. Default Re: GridView and hidden field

    i think that the e.row.attribute.add is the solution
    how in the RowDataBound event i can get the value on each row so
    i can use it for diffrent things
    thnaks
    peleg

    "Masudur" wrote:

    > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > i have a GridView and a hidden field :
    > > <asp:TemplateField Visible=false >
    > > <ItemTemplate >
    > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > id="hidIsActive" runat=server />
    > > </ItemTemplate>
    > > </asp:TemplateField>
    > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > field value,and to do something on certin conditions.
    > > the thing is that its value is set in a "Value" property while i try to
    > > access using :
    > > e.Row.Cells(5).Text
    > > i wont get anything beacuse i access the wrong properrty
    > > what can i do?
    > > thnaks in advance
    > > Peleg

    >
    > Hi...
    >
    > "1)when i check the sorce of html i dont see the hidden field - why is
    > that?"
    > hi id you set any controls property to visible=false... asp.net does
    > not render them in client page....
    > i am not sure wheither hidden value also do that or not...
    > you can use html hidden input field to test that... (ofcourse with
    > runat server attribute)
    >
    > i can see that you are using hidden field... but is that necessary?
    > what is "isActive"? doesn't seems to me it is coming from any
    > dataitem.. ratherthan page property...
    > if you want to perform any job depending on a cell value of the
    > dataitem... you should do in rowdatabound.. as i can see that you are
    > already doing that... so next thing is after accomplish your job...
    > you what to do some business on, lets say rowcommand... or
    > itemcommand,, in that case i assume you want to save the value
    > "IsActive" with the row...
    >
    > well you can use e.row.attribute.add.... to add some attribute value
    > in itemdataboud...
    > and then retrive in row command....
    >
    > Thanks
    > Md. Masudur Rahman (Munna)
    > kaz Software Ltd.
    > www.kaz.com.bd
    > http://munnacs.110mb.com
    >
    >


  4. Default Re: GridView and hidden field

    On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > i think that the e.row.attribute.add is the solution
    > how in the RowDataBound event i can get the value on each row so
    > i can use it for diffrent things
    > thnaks
    > peleg
    >
    > "Masudur" wrote:
    > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > i have a GridView and a hidden field :
    > > > <asp:TemplateField Visible=false >
    > > > <ItemTemplate >
    > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > id="hidIsActive" runat=server />
    > > > </ItemTemplate>
    > > > </asp:TemplateField>
    > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > field value,and to do something on certin conditions.
    > > > the thing is that its value is set in a "Value" property while i try to
    > > > access using :
    > > > e.Row.Cells(5).Text
    > > > i wont get anything beacuse i access the wrong properrty
    > > > what can i do?
    > > > thnaks in advance
    > > > Peleg

    >
    > > Hi...

    >
    > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > that?"
    > > hi id you set any controls property to visible=false... asp.net does
    > > not render them in client page....
    > > i am not sure wheither hidden value also do that or not...
    > > you can use html hidden input field to test that... (ofcourse with
    > > runat server attribute)

    >
    > > i can see that you are using hidden field... but is that necessary?
    > > what is "isActive"? doesn't seems to me it is coming from any
    > > dataitem.. ratherthan page property...
    > > if you want to perform any job depending on a cell value of the
    > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > already doing that... so next thing is after accomplish your job...
    > > you what to do some business on, lets say rowcommand... or
    > > itemcommand,, in that case i assume you want to save the value
    > > "IsActive" with the row...

    >
    > > well you can use e.row.attribute.add.... to add some attribute value
    > > in itemdataboud...
    > > and then retrive in row command....

    >
    > > Thanks
    > > Md. Masudur Rahman (Munna)
    > > kaz Software Ltd.
    > >www.kaz.com.bd
    > >http://munnacs.110mb.com


    Hi...


    protected void GridViewTasks_RowDataBound(object sender,
    GridViewRowEventArgs e)
    {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    e.Row.Attributes.Add("myCustomAttribute", true);
    }
    }

    this is the code for adding attribute to a row in rowdatabound
    i think i am kind of missing the point... what exactly you are trying
    to accomplish?


    Thanks
    Md. Masudur Rahman (Munna)
    kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com


  5. Default Re: GridView and hidden field

    ow now that i think i am not sure this is a good solutuin
    beacuse i wanted from start to put a hidden value beacuwe i got it from the db
    and the when the RowDataBound evernt occurs
    by the hidden value i put in each row i want to change the row color
    so what the correct way to do it?
    thnaks
    peleg

    "Masudur" wrote:

    > On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > i think that the e.row.attribute.add is the solution
    > > how in the RowDataBound event i can get the value on each row so
    > > i can use it for diffrent things
    > > thnaks
    > > peleg
    > >
    > > "Masudur" wrote:
    > > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > i have a GridView and a hidden field :
    > > > > <asp:TemplateField Visible=false >
    > > > > <ItemTemplate >
    > > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > > id="hidIsActive" runat=server />
    > > > > </ItemTemplate>
    > > > > </asp:TemplateField>
    > > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > > field value,and to do something on certin conditions.
    > > > > the thing is that its value is set in a "Value" property while i try to
    > > > > access using :
    > > > > e.Row.Cells(5).Text
    > > > > i wont get anything beacuse i access the wrong properrty
    > > > > what can i do?
    > > > > thnaks in advance
    > > > > Peleg

    > >
    > > > Hi...

    > >
    > > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > > that?"
    > > > hi id you set any controls property to visible=false... asp.net does
    > > > not render them in client page....
    > > > i am not sure wheither hidden value also do that or not...
    > > > you can use html hidden input field to test that... (ofcourse with
    > > > runat server attribute)

    > >
    > > > i can see that you are using hidden field... but is that necessary?
    > > > what is "isActive"? doesn't seems to me it is coming from any
    > > > dataitem.. ratherthan page property...
    > > > if you want to perform any job depending on a cell value of the
    > > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > > already doing that... so next thing is after accomplish your job...
    > > > you what to do some business on, lets say rowcommand... or
    > > > itemcommand,, in that case i assume you want to save the value
    > > > "IsActive" with the row...

    > >
    > > > well you can use e.row.attribute.add.... to add some attribute value
    > > > in itemdataboud...
    > > > and then retrive in row command....

    > >
    > > > Thanks
    > > > Md. Masudur Rahman (Munna)
    > > > kaz Software Ltd.
    > > >www.kaz.com.bd
    > > >http://munnacs.110mb.com

    >
    > Hi...
    >
    >
    > protected void GridViewTasks_RowDataBound(object sender,
    > GridViewRowEventArgs e)
    > {
    > if (e.Row.RowType == DataControlRowType.DataRow)
    > {
    > e.Row.Attributes.Add("myCustomAttribute", true);
    > }
    > }
    >
    > this is the code for adding attribute to a row in rowdatabound
    > i think i am kind of missing the point... what exactly you are trying
    > to accomplish?
    >
    >
    > Thanks
    > Md. Masudur Rahman (Munna)
    > kaz Software Ltd.
    > www.kaz.com.bd
    > http://munnacs.110mb.com
    >
    >


  6. Default Re: GridView and hidden field

    On Jul 12, 8:46 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > ow now that i think i am not sure this is a good solutuin
    > beacuse i wanted from start to put a hidden value beacuwe i got it from the db
    > and the when the RowDataBound evernt occurs
    > by the hidden value i put in each row i want to change the row color
    > so what the correct way to do it?
    > thnaks
    > peleg
    >
    > "Masudur" wrote:
    > > On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > i think that the e.row.attribute.add is the solution
    > > > how in the RowDataBound event i can get the value on each row so
    > > > i can use it for diffrent things
    > > > thnaks
    > > > peleg

    >
    > > > "Masudur" wrote:
    > > > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > i have a GridView and a hidden field :
    > > > > > <asp:TemplateField Visible=false >
    > > > > > <ItemTemplate >
    > > > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > > > id="hidIsActive" runat=server />
    > > > > > </ItemTemplate>
    > > > > > </asp:TemplateField>
    > > > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > > > field value,and to do something on certin conditions.
    > > > > > the thing is that its value is set in a "Value" property while i try to
    > > > > > access using :
    > > > > > e.Row.Cells(5).Text
    > > > > > i wont get anything beacuse i access the wrong properrty
    > > > > > what can i do?
    > > > > > thnaks in advance
    > > > > > Peleg

    >
    > > > > Hi...

    >
    > > > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > > > that?"
    > > > > hi id you set any controls property to visible=false... asp.net does
    > > > > not render them in client page....
    > > > > i am not sure wheither hidden value also do that or not...
    > > > > you can use html hidden input field to test that... (ofcourse with
    > > > > runat server attribute)

    >
    > > > > i can see that you are using hidden field... but is that necessary?
    > > > > what is "isActive"? doesn't seems to me it is coming from any
    > > > > dataitem.. ratherthan page property...
    > > > > if you want to perform any job depending on a cell value of the
    > > > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > > > already doing that... so next thing is after accomplish your job...
    > > > > you what to do some business on, lets say rowcommand... or
    > > > > itemcommand,, in that case i assume you want to save the value
    > > > > "IsActive" with the row...

    >
    > > > > well you can use e.row.attribute.add.... to add some attribute value
    > > > > in itemdataboud...
    > > > > and then retrive in row command....

    >
    > > > > Thanks
    > > > > Md. Masudur Rahman (Munna)
    > > > > kaz Software Ltd.
    > > > >www.kaz.com.bd
    > > > >http://munnacs.110mb.com

    >
    > > Hi...

    >
    > > protected void GridViewTasks_RowDataBound(object sender,
    > > GridViewRowEventArgs e)
    > > {
    > > if (e.Row.RowType == DataControlRowType.DataRow)
    > > {
    > > e.Row.Attributes.Add("myCustomAttribute", true);
    > > }
    > > }

    >
    > > this is the code for adding attribute to a row in rowdatabound
    > > i think i am kind of missing the point... what exactly you are trying
    > > to accomplish?

    >
    > > Thanks
    > > Md. Masudur Rahman (Munna)
    > > kaz Software Ltd.
    > >www.kaz.com.bd
    > >http://munnacs.110mb.com


    Well...

    hi... i got it...
    since you what it from beginning ... it kind of difficult........
    because after itemdatabound things will be there.... but still you
    have the option...
    since you are binding the grid view against some data source...the
    item you want to embade is already in your dataitem... right?
    so why don't you just use e.Row.DataItem and cust it to appropriate
    type... and then check value....

    Thanks
    Md. Masudur Rahman (Munna)
    kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com


  7. Default Re: GridView and hidden field

    to use e.Row.DataItem the data will appar on screnn and i want to avoid it

    "Masudur" wrote:

    > On Jul 12, 8:46 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > ow now that i think i am not sure this is a good solutuin
    > > beacuse i wanted from start to put a hidden value beacuwe i got it from the db
    > > and the when the RowDataBound evernt occurs
    > > by the hidden value i put in each row i want to change the row color
    > > so what the correct way to do it?
    > > thnaks
    > > peleg
    > >
    > > "Masudur" wrote:
    > > > On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > i think that the e.row.attribute.add is the solution
    > > > > how in the RowDataBound event i can get the value on each row so
    > > > > i can use it for diffrent things
    > > > > thnaks
    > > > > peleg

    > >
    > > > > "Masudur" wrote:
    > > > > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > > i have a GridView and a hidden field :
    > > > > > > <asp:TemplateField Visible=false >
    > > > > > > <ItemTemplate >
    > > > > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > > > > id="hidIsActive" runat=server />
    > > > > > > </ItemTemplate>
    > > > > > > </asp:TemplateField>
    > > > > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > > > > field value,and to do something on certin conditions.
    > > > > > > the thing is that its value is set in a "Value" property while i try to
    > > > > > > access using :
    > > > > > > e.Row.Cells(5).Text
    > > > > > > i wont get anything beacuse i access the wrong properrty
    > > > > > > what can i do?
    > > > > > > thnaks in advance
    > > > > > > Peleg

    > >
    > > > > > Hi...

    > >
    > > > > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > > > > that?"
    > > > > > hi id you set any controls property to visible=false... asp.net does
    > > > > > not render them in client page....
    > > > > > i am not sure wheither hidden value also do that or not...
    > > > > > you can use html hidden input field to test that... (ofcourse with
    > > > > > runat server attribute)

    > >
    > > > > > i can see that you are using hidden field... but is that necessary?
    > > > > > what is "isActive"? doesn't seems to me it is coming from any
    > > > > > dataitem.. ratherthan page property...
    > > > > > if you want to perform any job depending on a cell value of the
    > > > > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > > > > already doing that... so next thing is after accomplish your job...
    > > > > > you what to do some business on, lets say rowcommand... or
    > > > > > itemcommand,, in that case i assume you want to save the value
    > > > > > "IsActive" with the row...

    > >
    > > > > > well you can use e.row.attribute.add.... to add some attribute value
    > > > > > in itemdataboud...
    > > > > > and then retrive in row command....

    > >
    > > > > > Thanks
    > > > > > Md. Masudur Rahman (Munna)
    > > > > > kaz Software Ltd.
    > > > > >www.kaz.com.bd
    > > > > >http://munnacs.110mb.com

    > >
    > > > Hi...

    > >
    > > > protected void GridViewTasks_RowDataBound(object sender,
    > > > GridViewRowEventArgs e)
    > > > {
    > > > if (e.Row.RowType == DataControlRowType.DataRow)
    > > > {
    > > > e.Row.Attributes.Add("myCustomAttribute", true);
    > > > }
    > > > }

    > >
    > > > this is the code for adding attribute to a row in rowdatabound
    > > > i think i am kind of missing the point... what exactly you are trying
    > > > to accomplish?

    > >
    > > > Thanks
    > > > Md. Masudur Rahman (Munna)
    > > > kaz Software Ltd.
    > > >www.kaz.com.bd
    > > >http://munnacs.110mb.com

    >
    > Well...
    >
    > hi... i got it...
    > since you what it from beginning ... it kind of difficult........
    > because after itemdatabound things will be there.... but still you
    > have the option...
    > since you are binding the grid view against some data source...the
    > item you want to embade is already in your dataitem... right?
    > so why don't you just use e.Row.DataItem and cust it to appropriate
    > type... and then check value....
    >
    > Thanks
    > Md. Masudur Rahman (Munna)
    > kaz Software Ltd.
    > www.kaz.com.bd
    > http://munnacs.110mb.com
    >
    >


  8. Default Re: GridView and hidden field

    On Jul 14, 4:08 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > to use e.Row.DataItem the data will appar on screnn and i want to avoid it
    >
    >
    >
    > "Masudur" wrote:
    > > On Jul 12, 8:46 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > ow now that i think i am not sure this is a good solutuin
    > > > beacuse i wanted from start to put a hidden value beacuwe i got it from the db
    > > > and the when the RowDataBound evernt occurs
    > > > by the hidden value i put in each row i want to change the row color
    > > > so what the correct way to do it?
    > > > thnaks
    > > > peleg

    >
    > > > "Masudur" wrote:
    > > > > On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > i think that the e.row.attribute.add is the solution
    > > > > > how in the RowDataBound event i can get the value on each row so
    > > > > > i can use it for diffrent things
    > > > > > thnaks
    > > > > > peleg

    >
    > > > > > "Masudur" wrote:
    > > > > > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > > > i have a GridView and a hidden field :
    > > > > > > > <asp:TemplateField Visible=false >
    > > > > > > > <ItemTemplate >
    > > > > > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > > > > > id="hidIsActive" runat=server />
    > > > > > > > </ItemTemplate>
    > > > > > > > </asp:TemplateField>
    > > > > > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > > > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > > > > > field value,and to do something on certin conditions.
    > > > > > > > the thing is that its value is set in a "Value" property while i try to
    > > > > > > > access using :
    > > > > > > > e.Row.Cells(5).Text
    > > > > > > > i wont get anything beacuse i access the wrong properrty
    > > > > > > > what can i do?
    > > > > > > > thnaks in advance
    > > > > > > > Peleg

    >
    > > > > > > Hi...

    >
    > > > > > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > > > > > that?"
    > > > > > > hi id you set any controls property to visible=false... asp.net does
    > > > > > > not render them in client page....
    > > > > > > i am not sure wheither hidden value also do that or not...
    > > > > > > you can use html hidden input field to test that... (ofcourse with
    > > > > > > runat server attribute)

    >
    > > > > > > i can see that you are using hidden field... but is that necessary?
    > > > > > > what is "isActive"? doesn't seems to me it is coming from any
    > > > > > > dataitem.. ratherthan page property...
    > > > > > > if you want to perform any job depending on a cell value of the
    > > > > > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > > > > > already doing that... so next thing is after accomplish your job...
    > > > > > > you what to do some business on, lets say rowcommand... or
    > > > > > > itemcommand,, in that case i assume you want to save the value
    > > > > > > "IsActive" with the row...

    >
    > > > > > > well you can use e.row.attribute.add.... to add some attribute value
    > > > > > > in itemdataboud...
    > > > > > > and then retrive in row command....

    >
    > > > > > > Thanks
    > > > > > > Md. Masudur Rahman (Munna)
    > > > > > > kaz Software Ltd.
    > > > > > >www.kaz.com.bd
    > > > > > >http://munnacs.110mb.com

    >
    > > > > Hi...

    >
    > > > > protected void GridViewTasks_RowDataBound(object sender,
    > > > > GridViewRowEventArgs e)
    > > > > {
    > > > > if (e.Row.RowType == DataControlRowType.DataRow)
    > > > > {
    > > > > e.Row.Attributes.Add("myCustomAttribute", true);
    > > > > }
    > > > > }

    >
    > > > > this is the code for adding attribute to a row in rowdatabound
    > > > > i think i am kind of missing the point... what exactly you are trying
    > > > > to accomplish?

    >
    > > > > Thanks
    > > > > Md. Masudur Rahman (Munna)
    > > > > kaz Software Ltd.
    > > > >www.kaz.com.bd
    > > > >http://munnacs.110mb.com

    >
    > > Well...

    >
    > > hi... i got it...
    > > since you what it from beginning ... it kind of difficult........
    > > because after itemdatabound things will be there.... but still you
    > > have the option...
    > > since you are binding the grid view against some data source...the
    > > item you want to embade is already in your dataitem... right?
    > > so why don't you just use e.Row.DataItem and cust it to appropriate
    > > type... and then check value....

    >
    > > Thanks
    > > Md. Masudur Rahman (Munna)
    > > kaz Software Ltd.
    > >www.kaz.com.bd
    > >http://munnacs.110mb.com- Hide quoted text -

    >
    > - Show quoted text -


    Hi... not necessary every dataitem you need to show... .
    modify the column collection and make all the not necessary column's
    visible property to false...

    Thanks
    Md. Masudur Rahman (Munna)
    kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com


  9. Default Re: GridView and hidden field

    u actullay mean that the DataItem in e.Row.DataItem
    will still contain all the values that i have in my select
    but are not actually visible to the user?
    if yes then GREAT!

    "Masudur" wrote:

    > On Jul 14, 4:08 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > to use e.Row.DataItem the data will appar on screnn and i want to avoid it
    > >
    > >
    > >
    > > "Masudur" wrote:
    > > > On Jul 12, 8:46 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > ow now that i think i am not sure this is a good solutuin
    > > > > beacuse i wanted from start to put a hidden value beacuwe i got it from the db
    > > > > and the when the RowDataBound evernt occurs
    > > > > by the hidden value i put in each row i want to change the row color
    > > > > so what the correct way to do it?
    > > > > thnaks
    > > > > peleg

    > >
    > > > > "Masudur" wrote:
    > > > > > On Jul 12, 3:04 pm, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > > i think that the e.row.attribute.add is the solution
    > > > > > > how in the RowDataBound event i can get the value on each row so
    > > > > > > i can use it for diffrent things
    > > > > > > thnaks
    > > > > > > peleg

    > >
    > > > > > > "Masudur" wrote:
    > > > > > > > On Jul 12, 3:16 am, pelegk1 <pele...@discussions.microsoft.com> wrote:
    > > > > > > > > i have a GridView and a hidden field :
    > > > > > > > > <asp:TemplateField Visible=false >
    > > > > > > > > <ItemTemplate >
    > > > > > > > > <asp:HiddenField Value="<%#Eval("isActive")%>"
    > > > > > > > > id="hidIsActive" runat=server />
    > > > > > > > > </ItemTemplate>
    > > > > > > > > </asp:TemplateField>
    > > > > > > > > 1)when i check the sorce of html i dont see the hidden field - why is that?
    > > > > > > > > 2)on RowDataBound event, when i check the rows i want to check thr above
    > > > > > > > > field value,and to do something on certin conditions.
    > > > > > > > > the thing is that its value is set in a "Value" property while i try to
    > > > > > > > > access using :
    > > > > > > > > e.Row.Cells(5).Text
    > > > > > > > > i wont get anything beacuse i access the wrong properrty
    > > > > > > > > what can i do?
    > > > > > > > > thnaks in advance
    > > > > > > > > Peleg

    > >
    > > > > > > > Hi...

    > >
    > > > > > > > "1)when i check the sorce of html i dont see the hidden field - why is
    > > > > > > > that?"
    > > > > > > > hi id you set any controls property to visible=false... asp.net does
    > > > > > > > not render them in client page....
    > > > > > > > i am not sure wheither hidden value also do that or not...
    > > > > > > > you can use html hidden input field to test that... (ofcourse with
    > > > > > > > runat server attribute)

    > >
    > > > > > > > i can see that you are using hidden field... but is that necessary?
    > > > > > > > what is "isActive"? doesn't seems to me it is coming from any
    > > > > > > > dataitem.. ratherthan page property...
    > > > > > > > if you want to perform any job depending on a cell value of the
    > > > > > > > dataitem... you should do in rowdatabound.. as i can see that you are
    > > > > > > > already doing that... so next thing is after accomplish your job...
    > > > > > > > you what to do some business on, lets say rowcommand... or
    > > > > > > > itemcommand,, in that case i assume you want to save the value
    > > > > > > > "IsActive" with the row...

    > >
    > > > > > > > well you can use e.row.attribute.add.... to add some attribute value
    > > > > > > > in itemdataboud...
    > > > > > > > and then retrive in row command....

    > >
    > > > > > > > Thanks
    > > > > > > > Md. Masudur Rahman (Munna)
    > > > > > > > kaz Software Ltd.
    > > > > > > >www.kaz.com.bd
    > > > > > > >http://munnacs.110mb.com

    > >
    > > > > > Hi...

    > >
    > > > > > protected void GridViewTasks_RowDataBound(object sender,
    > > > > > GridViewRowEventArgs e)
    > > > > > {
    > > > > > if (e.Row.RowType == DataControlRowType.DataRow)
    > > > > > {
    > > > > > e.Row.Attributes.Add("myCustomAttribute", true);
    > > > > > }
    > > > > > }

    > >
    > > > > > this is the code for adding attribute to a row in rowdatabound
    > > > > > i think i am kind of missing the point... what exactly you are trying
    > > > > > to accomplish?

    > >
    > > > > > Thanks
    > > > > > Md. Masudur Rahman (Munna)
    > > > > > kaz Software Ltd.
    > > > > >www.kaz.com.bd
    > > > > >http://munnacs.110mb.com

    > >
    > > > Well...

    > >
    > > > hi... i got it...
    > > > since you what it from beginning ... it kind of difficult........
    > > > because after itemdatabound things will be there.... but still you
    > > > have the option...
    > > > since you are binding the grid view against some data source...the
    > > > item you want to embade is already in your dataitem... right?
    > > > so why don't you just use e.Row.DataItem and cust it to appropriate
    > > > type... and then check value....

    > >
    > > > Thanks
    > > > Md. Masudur Rahman (Munna)
    > > > kaz Software Ltd.
    > > >www.kaz.com.bd
    > > >http://munnacs.110mb.com- Hide quoted text -

    > >
    > > - Show quoted text -

    >
    > Hi... not necessary every dataitem you need to show... .
    > modify the column collection and make all the not necessary column's
    > visible property to false...
    >
    > Thanks
    > Md. Masudur Rahman (Munna)
    > kaz Software Ltd.
    > www.kaz.com.bd
    > http://munnacs.110mb.com
    >
    >


+ Reply to Thread

Similar Threads

  1. Hidden field doesn't work?
    By Application Development in forum DOTNET
    Replies: 1
    Last Post: 09-19-2007, 04:58 PM
  2. can't reset a hidden field in form
    By Application Development in forum Javascript
    Replies: 17
    Last Post: 08-13-2007, 04:31 PM
  3. How do we get the value from the hidden field ?
    By Application Development in forum DOTNET
    Replies: 4
    Last Post: 07-18-2007, 10:01 AM
  4. assign value to hidden field in custom list,
    By Application Development in forum Sharepoint
    Replies: 1
    Last Post: 05-11-2007, 02:54 AM
  5. assign value to hidden field in custom list,
    By Application Development in forum Sharepoint
    Replies: 1
    Last Post: 05-11-2007, 02:53 AM