Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1840
WebDataGrid ClientSide Add not working
posted

Hello,

litle problem:

Env.: VS 2008 Prof., Net Adv. 9.2

i have a WebDataGrid with a Sql-Datasource. But AutoGenerateColumns="False"; since i only need some colums, and i set them manually in the 'columns'-section (prim-key included).

I want to add a new row in JavaScript without AutoCrud (i must change some cell-values programmatical and then the user can edit the other cells; so i set Autocrud to false). These are the behaviors:

                        <Behaviors>
                            <ig:RowSelectors RowNumbering="True">
                            </ig:RowSelectors>
                            <ig:Selection CellClickAction="Row" RowSelectType="Single">
                                <SelectionClientEvents RowSelectionChanged="wdg_Sel_Changed" />
                            </ig:Selection>
                            <ig:EditingCore AutoCRUD="False">
                                <Behaviors>
                                    <ig:RowAdding >
                                   
                                    </ig:RowAdding>
                                </Behaviors>
                            </ig:EditingCore>
                        </Behaviors>
                        <ClientEvents Initialize="wdg_Tabelle_Init" />
    

Following my js:

                if (wdg_obj != null) {   // the grid
                    var rows = wdg_obj.get_rows();
                    // funktioniert nicht! rows.add({ "id": "-1" });
                    rows.add(["-1", "Point", "Neuer Titel", "Neue Beschreibung", " ", " ", " ", " ", " ", " ", " "]);
   There are 11 Cells in the row; the row.add return no error; but in the rows collection is no new row added!

What's wrong with my code ??

Missing some behaviors??

Parents
  • 14049
    Suggested Answer
    Offline posted

    Do you handle rowadding on the server and commit the changes to the data base?

    After that you need to call DataBind() and the row should appear.

Reply Children
No Data