This is a migrated thread and some comments may be shown as answers.

Column sizing of GridNumericColumn

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morris Coffey
Top achievements
Rank 1
Morris Coffey asked on 03 Aug 2008, 12:28 AM
I cannot change the Grid...Controls textbox widths.  I want to limit the below textbox to 8 characters.  Especially limit the associated Filter textbox for this control.  The default group headings are much larger than required.

Thanks for the assistance.

<

telerik:GridNumericColumn AllowFiltering="true" AllowSorting="true"

AutoPostBackOnFilter="true" DataField="Miles" DataFormatString="{0:N0}"

DataType="System.Int32" Groupable="true" HeaderText="Miles"

ItemStyle-HorizontalAlign="Right" MaxLength="8" NumericType="Number"

Resizable="true" UniqueName="Miles" >

<FooterStyle HorizontalAlign="Right" />

<ItemStyle HorizontalAlign="Right" />

</telerik:GridNumericColumn>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Aug 2008, 06:09 AM
Hi Morris,

Try the following code snippet to limit the characters entered in the Filter textbox of the GridNumericColumn.

CS:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridFilteringItem) 
        { 
            GridFilteringItem filter = (GridFilteringItem)e.Item; 
            RadNumericTextBox txtbx = (RadNumericTextBox)filter["Miles"].Controls[0]; 
            txtbx.MaxLength = 8
        } 
    } 


Thanks
Shinu.
Tags
Grid
Asked by
Morris Coffey
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or