3 Answers, 1 is accepted
0
Hi Curtis,
The following snippet shows how you can access the textbox and set the width:
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
The following snippet shows how you can access the textbox and set the width:
foreach
(var row
in
this
.radGridView1.TableElement.VisualRows)
{
if
(row
is
GridSearchRowElement)
{
var searchRow = row
as
GridSearchRowElement;
searchRow.SearchCellElement.SearchBoxWidth = 50;
break
;
}
}
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 27 Jul 2018, 09:49 PM
Thank you for the quick reply, Dimitar!
Unfortunately, your approach does not yield the results i was expecting and while i do not know exactly why, i think it's because i am not using a DataBound grid.
this.radGridView1.TableElement.VisualRows.Count = 0
thig.radGridView1.Rows.Count = 527
But because i have nothing in VisualRows - i can't seem to find the GridSearchRowElement.
Any thoughts?
-Curtis
0
Hi Curtis,
You need to make sure that the grid is loaded before using this code, use the OnLoad method for example:
Let me know how this works for you.
Regards,
Dimitar
Progress Telerik
You need to make sure that the grid is loaded before using this code, use the OnLoad method for example:
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
foreach
(var row
in
this
.radGridView1.TableElement.VisualRows)
{
if
(row
is
GridSearchRowElement)
{
var searchRow = row
as
GridSearchRowElement;
searchRow.SearchCellElement.SearchBoxWidth = 50;
break
;
}
}
}
Let me know how this works for you.
Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.