Click to See Complete Forum and Search --> : TextBoxes in GridView


akshatha306
July 31st, 2006, 08:10 AM
hi all,

I have a gridView with 2 columns.
The first column contains all TextBoxes which should contain data from the database.
Second column should have delete button...

I have got the design. but how do i populate data to the textboxes on page load. i can get the data in a separate column but not in the text box column. somebody can help me out with this?

And also i want the text boxes in the column to be of different sizes.. how can i get them.

Somebosy help me out...:-(

jasonli
July 31st, 2006, 08:41 AM
Here is an example of GridView:


<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Bounded">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Data") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
</asp:GridView>

akshatha306
July 31st, 2006, 09:31 AM
But i want the textBox in the first row to get value from a different column in the same table and also the length of that text box to be more. how can i separately give this only to the textBox in the first row

jasonli
July 31st, 2006, 11:29 AM
Oh, I know what you want in fact. You wanna get and set the width of columns. Honestly, I don't know how. If you figure it out, please let me know.

akshatha306
August 1st, 2006, 12:07 AM
ok i'll tell u once i know