Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
andrei #1
ReadOnly checkbox in datagrid
Hi Group,
I have a checkbox column in a web datagrid which is related to a "Product in
stock" property.
The grid is in view mode, so the user can't (and shouldn't) change anything
in the grid.
What I need is to show a "ReadOnly" checkbox in the grid, but not a disabled
one (grayed out).
I'm using a template column and the only property I can set is "enabled".
There is no "ReadOnly" attribute like for the <INPUT type=... > HTML
controls
Anyone knows how to do that ?
And I don't want to replace the checkbox with letters or words, like Y/N,
Yes/No, etc. It has to stay a checkbox.
This is the code I use:
<ItemTemplate>
<asp:CheckBox
id=chkInStock
Checked='<%# DataBinder.Eval(Container, "DataItem.InStock") %>'
Runat="server"
Enabled=False > *** to be replaced...***
</asp:CheckBox>
</ItemTemplate>
Many thanks.
Andrei.
andrei Guest
-
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
how to add checkbox to a datagrid?
Hello, I am trying to add a checkbox to a datagrid. But i dont want to bind a data with the checkBox. I only want to know if any user has chacked... -
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False
I have created a Template Column and Added to a Datagrid, which contains a checkBox. The column is not Binded to any column of the Dataset, but is... -
REPOST: Column [blah] is readonly on Datagrid UpdateCommand event
Forgive the repost, but this is really troublesome and I hope SOMEONE can shed some light on it. I am trying to update a datarow via in-place... -
Readonly Checkbox?
Well, I'm sure you guys know that the ASP.NET Checkbox control doesn't have a Readonly property. I'm writing an application where I need it to... -
andrei #2
Readonly checkbox in Datagrid
Hi Group,
I have a checkbox column in a web datagrid which is related to a "Product in
stock" property.
The grid is in view mode, so the user can't (and shouldn't) change anything
in the grid.
What I need is to show a "ReadOnly" checkbox in the grid, but not a disabled
one (grayed out).
I'm using a template column and the only property I can set is "enabled".
There is no "ReadOnly" attribute like for the <INPUT type=... > HTML
controls
Anyone knows how to do that ?
And I don't want to replace the checkbox with letters or words, like Y/N,
Yes/No, etc. It has to stay a checkbox.
This is the code I use:
<ItemTemplate>
<asp:CheckBox
id=chkInStock
Checked='<%# DataBinder.Eval(Container, "DataItem.InStock") %>'
Runat="server"
Enabled=False > *** to be replaced...***
</asp:CheckBox>
</ItemTemplate>
Many thanks.
Andrei.
andrei Guest
-
Tony #3
Re: ReadOnly checkbox in datagrid
What if you want it to be editable only when the corresponding row is being
edited?
"Prasad" <prasadh_ms@hotmail.com> wrote in message
news:%23nFOWSzVDHA.2012@TK2MSFTNGP10.phx.gbl...the> Hi
>
> This will generate checkbox and you will not be able to uncheck it. Add"Product> onclick to the checkbox.Note it should runat clientend and not at server
>
> <input type=checkbox onclick="this.checked=true" checked>
>
> HTH
> Prasad
>
> "andrei" <andrei.toma@era-environmental.com> wrote in message
> news:emrkqJqVDHA.2016@TK2MSFTNGP09.phx.gbl...> > Hi Group,
> >
> > I have a checkbox column in a web datagrid which is related to a"enabled".> in> anything> > stock" property.
> > The grid is in view mode, so the user can't (and shouldn't) change> disabled> > in the grid.
> >
> > What I need is to show a "ReadOnly" checkbox in the grid, but not a> > one (grayed out).
> > I'm using a template column and the only property I can set isY/N,> >
> > There is no "ReadOnly" attribute like for the <INPUT type=... > HTML
> > controls
> >
> > Anyone knows how to do that ?
> >
> > And I don't want to replace the checkbox with letters or words, like>> > Yes/No, etc. It has to stay a checkbox.
> >
> > This is the code I use:
> >
> > <ItemTemplate>
> > <asp:CheckBox
> > id=chkInStock
> > Checked='<%# DataBinder.Eval(Container, "DataItem.InStock") %>'
> > Runat="server"
> > Enabled=False > *** to be replaced...***
> > </asp:CheckBox>
> > </ItemTemplate>
> >
> > Many thanks.
> > Andrei.
> >
> >
>
Tony Guest



Reply With Quote

