i had one Grid,in that grid one column is drop down like this
<asp:TemplateField HeaderText="Type" ControlStyle-Width="55px">
<itemtemplate>
<asp:DropDownList ID="ddltype" runat="server" SelectedText='<%# Eval("Taxfeetype").ToString().ToLower().Equals("tax") ? "Tax" : "Fee" %>'>
<asp:ListItem Value="fee">Fee
<asp:ListItem Value="tax">Tax
</itemtemplate>
now i had one sql data table with the following columns
Taxfeetype nvarchar(5),
Decription nvarchar(50),
PercentorFlat nvarchar(20),
TaxFeeValue decimal(10,4)
now if i enter one record like this:
insert into Testtaxandfess values('Tax','Surpls Lines Tax','percent',3.0000)
automatically in dropdown tax should be selected...
similarly if i write record like this:
insert into Testtaxandfess values('Fee','Inspection Fee','percent',100.0000)
fee should be defaultly selected....
please help