Questions regarding datagrid control

  • Thread starter Thread starter sean
  • Start date Start date
S

sean

Hi There,

I would like to find out if I can modify some of the properties of a
datagrid.

1. How can modify the width of the fields ? when hit the update button all
of the fields are around 200px wide, I have tried to use "size" but I
receive an error.
2. can I validate the fields in a datagrid say for numeric / currency
datatype ?
3. how can I make a password field in a datagrid?
4. When the datagrid is in edit mode can I adjust the size of the datagrid
width itself?

Sean - Thanks in adavnce for your answer


<asp:DataGrid id="dgUsers" runat="server"
AutoGenerateColumns="False" CellPadding="2" width=400
HeaderStyle-BackColor="purple"
HeaderStyle-ForeColor="White"
HeaderStyle-HorizontalAlign="Center"
HeaderStyle-Font-Bold="True"

EditItemStyle-BackColor="#eeeeee"

OnEditCommand="dgUsers_Edit"
OnUpdateCommand="dgUsers_Update"
OnCancelCommand="dgUsers_Cancel">

<columns>
<asp:EditCommandColumn EditText="Edit Info"
ButtonType="PushButton"
UpdateText="Update" CancelText="Cancel" />
<asp:BoundColumn HeaderText="ID" DataField="CustID"
readonly=true/>
<asp:BoundColumn HeaderText="First Name"
DataField="firstname" />
<asp:BoundColumn HeaderText="Last Name" DataField="lastname"
/>
<asp:BoundColumn HeaderText="Address" DataField="address" />
<asp:BoundColumn HeaderText="Suburb" DataField="suburb" />
<asp:BoundColumn HeaderText="Postcode"
DataField="postcode"/>
<asp:BoundColumn HeaderText="Email Address"
DataField="email" />
</columns>
</asp:DataGrid>
 
Back
Top