Hello!
When I enter edit mode in a Telerik radgrid I end up with all the textboxes beeing in different width.
I thought of solving this, by looping through all the items that is beeing edited and set them to System.Web.UI.WebControls.Unit.Pixel(300); to change the size. But I am doing something wrong here, I can't get it to work? And I want to refrain from using the getColumnEditor.
I thought of using it like this: But I cannot get it to work. Any idea?
Any idea what to do to make them into the same size?
On a side note, a total different question, Is it possible to set .Enabled status (ReadOnly) programatically without knowing what type the column is?
At the moment I am just stuck with having to iterate through and check whether the column textbox is a GridTextBoxColumnEditor / GridNumericColumnEditor and so forth. It's annoying way to solve it.
Eg.
See? I even have to specify NumericTextBox so I can't make generic solution to this? Anyone knows?
Sorry for having two questions in one thread, hope it is OK.
Best Regards
Nicklas
When I enter edit mode in a Telerik radgrid I end up with all the textboxes beeing in different width.
I thought of solving this, by looping through all the items that is beeing edited and set them to System.Web.UI.WebControls.
I thought of using it like this: But I cannot get it to work. Any idea?
protected
void
radgrid1_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
//the item is in edit mode
GridEditableItem editedItem = e.Item
as
GridEditableItem;
editedItem.Width = Unit.Pixel(300);
editedItem.Height = Unit.Pixel(300);
}
}
Any idea what to do to make them into the same size?
On a side note, a total different question, Is it possible to set .Enabled status (ReadOnly) programatically without knowing what type the column is?
At the moment I am just stuck with having to iterate through and check whether the column textbox is a GridTextBoxColumnEditor / GridNumericColumnEditor and so forth. It's annoying way to solve it.
Eg.
if
(columnEditor
is
GridTextBoxColumnEditor)
{
GridTextBoxColumnEditor item = columnEditor
as
GridTextBoxColumnEditor;
item.TextBoxControl.Enabled = false;
// To hide completely item.TextBoxControl.ReadOnly = statusReadable ? false : true;
}
else if (columnEditor is GridNumericColumnEditor)
{
GridNumericColumnEditor item = columnEditor as GridNumericColumnEditor;
item.NumericTextBox.Enabled = false;
}
See? I even have to specify NumericTextBox so I can't make generic solution to this? Anyone knows?
Sorry for having two questions in one thread, hope it is OK.
Best Regards
Nicklas