I am using a datagri control on my web page. I edit, update and cancel on this control.
------------------------
OnCancelCommand="cmd_cancel">
-------------------------
The problem is when I click the edit button, textbox's showing at rows which I want to edit. No problem at this point. But This textbox's width is too long and I want to edit this textbox's lengths. How may I do that?
SenthilkumarRank #387 · 6.5K reputationPosted Apr 5, 2012, 4:01 AM EDT
You can restrict the width of the text box in either way
If you want to maintain this size in many problems then you are adivsed to do through css
.TextBox85
{
width:85px;
}
If you want to set the size at the time of editing then edit command,
you can find the control and set the width to it.
yokzuRank #5,421 · 300 reputationPosted Apr 5, 2012, 4:09 AM EDT
But there is no textbox control on my code. I mean When I click the "edit", textbox's appears automatically.
-------------------------------------------------------------------
OnCancelCommand="komut_cancel" CellPadding="4" ForeColor="#333333" GridLines="None" Width="400px" >
-------------------------------------------------------------------
When I change the "editItemStyle" propeties above, I can change somethings but not textbox's.
Ajay Patel148 reputationPosted Jun 1, 2012, 12:43 AM EDT
but when you use bound fields then you can esize textboxes from edit Command by,
((Textbox)(e.rows[e.editIndex].cell[0].control[0])).width = 100px;
try this....
sathish kumar115 reputationPosted Jun 11, 2012, 4:06 AM EDT