public void jsonFormatTable(IUimDataContext dataContext, ArrayList prelistTable) { ArrayList listRow = new ArrayList(); foreach (object table in prelistTable) { //MessageBox.Show("START FOR LOOP TABLE"); IUimTableSectionContext tablecontext = dataContext.FindTableSection(table.ToString()); // MessageBox.Show("TABLE NAME:" +table.ToString()); // MessageBox.Show("Count Row:" +tablecontext.RowCount.ToString()); string[] column = tablecontext.GetFieldNames(); foreach (string c in column) { //MessageBox.Show("START FOR COLUMN"); //MessageBox.Show("TABLE:"+table.ToString()+ "COLUMN :"+c); for (int i = 0; i < tablecontext.RowCount; i++) { IUimFieldDataContext datafield = tablecontext.GetFieldAt(i, c); string value = datafield.ValueAsString; listRow.Add(value); } string jsonformat = JsonConvert.SerializeObject(listRow); listRow.Clear(); string hname = c.Substring(2); hiddenfield = dataContext.FindFieldDataContext(hname); hiddenfield.SetValue(jsonformat); //MessageBox.Show("TABLE NAME =" +table.ToString()); //MessageBox.Show("Set Field Hidden =" + hname); //MessageBox.Show("VALUE =" +jsonformat); } } }
public void InsertRow(IUimTableSectionContext tableContext, int rowIndex) { string fname = tableContext.GetFieldNames()[0]; //MessageBox.Show("START Insert row fname = "+fname ); IUimFieldDataContext x = tableContext.GetFieldAt(rowIndex, fname); x.SetValue(wform.fundName); wform.fundName = string.Empty; }
/// <summary> /// /// </summary> /// <param name="tableContext"></param> /// <param name="rowIndex"></param> public void InsertRow(IUimTableSectionContext tableContext, int rowIndex) { try { string fname = tableContext.GetFieldNames()[0]; //MessageBox.Show("START Insert row fname = "+fname ); IUimFieldDataContext x = tableContext.GetFieldAt(rowIndex, fname); x.SetValue(wform.fundName); wform.fundName = string.Empty; } catch (Exception e) { string error = e.StackTrace.ToString(); } }