D
dada
..... After 3 weeks of my searching for solvation, I have made some new
function and I got selected item correct. But now is again another
problem with refreshing grid, because it writes the right data bu it
doesn`t show it until some refresh isn`t clicked
...
If someone can help I would preacheate it,
Thanks Dada
<asp:TemplateColumn HeaderText="Institucija">
<HeaderStyle Width="350pt"></HeaderStyle>
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Institucije") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp
ropDownList id=DropDownList1 runat="server" Width="239px"
DataMember="Institucije" DataSource="<%# dsDepartmani %>"
DataTextField="Naziv" DataValueField="ID institucije"
SelectedIndex='<%# DajID((string)DataBinder.Eval(Container,
"DataItem.Institucije")) %>'>
</asp
ropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
protected int DajID(string naziv)
{
for (int i=0; i<dsDepartmani.Institucije.DefaultView.Count;i++)
{
if(dsDepartmani.Institucije.DefaultView["Naziv"].ToString()==naziv)
{
return i;
}
}
return 0;
}
function and I got selected item correct. But now is again another
problem with refreshing grid, because it writes the right data bu it
doesn`t show it until some refresh isn`t clicked
If someone can help I would preacheate it,
Thanks Dada
<asp:TemplateColumn HeaderText="Institucija">
<HeaderStyle Width="350pt"></HeaderStyle>
<ItemTemplate>
<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Institucije") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp
DataMember="Institucije" DataSource="<%# dsDepartmani %>"
DataTextField="Naziv" DataValueField="ID institucije"
SelectedIndex='<%# DajID((string)DataBinder.Eval(Container,
"DataItem.Institucije")) %>'>
</asp
</EditItemTemplate>
</asp:TemplateColumn>
protected int DajID(string naziv)
{
for (int i=0; i<dsDepartmani.Institucije.DefaultView.Count;i++)
{
if(dsDepartmani.Institucije.DefaultView["Naziv"].ToString()==naziv)
{
return i;
}
}
return 0;
}