I have solved my problem in some diffrend way...

Discussion in 'ASP .Net Datagrid Control' started by dada, Mar 5, 2004.

  1. dada

    dada Guest

    ..... 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:DropDownList id=DropDownList1 runat="server" Width="239px"
    DataMember="Institucije" DataSource="<%# dsDepartmani %>"
    DataTextField="Naziv" DataValueField="ID institucije"
    SelectedIndex='<%# DajID((string)DataBinder.Eval(Container,
    "DataItem.Institucije")) %>'>
    </asp:DropDownList>
    </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;
    }
     
    dada, Mar 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Giovanni Tumiati
    Replies:
    2
    Views:
    349
    Grant Edwards
    Jun 25, 2005
  2. Jp Calderone
    Replies:
    2
    Views:
    404
    Grant Edwards
    Jun 25, 2005
  3. dolphin
    Replies:
    3
    Views:
    384
    rossum
    Mar 9, 2007
  4. Michael Bacarella
    Replies:
    26
    Views:
    1,424
    harri
    Nov 20, 2007
  5. Ramon F Herrera
    Replies:
    10
    Views:
    497
    Gordon Beaton
    Dec 14, 2007
Loading...

Share This Page