or
| DataRow[] dr = Products.Select("ProductID = " + editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"]); |
| protected void Grid2_UpdateCommand(object source,GridCommandEventArgs e) |
| { |
| GridEditableItem editable = e.Item as GridEditableItem; |
| UserControl uc = (UserControl) e.Item.FindControl(GridEditFormItem.EditFormUserControlID); |
| DataRow[] dr = Products.Select("ProductID = " + editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"]); |
| // Can not find the ID to update .... |
| if(dr.Length != 1) |
| { |
| Grid2.Controls.Add(new LiteralControl("Can not find Item to update!!")); |
| e.Canceled = true; |
| return; |
| } |
| try |
| { |
| Hashtable ht = CollectFormData(e); |
| ht["ProductID"] = (int)editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"]; |
| SqlDataAdapter da = new SqlDataAdapter(productSelect, ConnObject); |
| SqlCommandBuilder cb = new SqlCommandBuilder(da); |
| dr[0].BeginEdit(); |
| foreach (DictionaryEntry entry in ht) |
| { |
| dr[0][(string)entry.Key] = entry.Value; |
| } |
| dr[0].EndEdit(); |
| ConnObject.Open(); |
| da.Update(dataSet, "Products"); |
| } |
| catch(Exception ex) |
| { |
| Grid2.Controls.Add(new LiteralControl("Can not update record !!")); |
| e.Canceled = true; |
| } |
| finally |
| { |
| ConnObject.Close(); |
| } |
| } |
Hello
I want to position my chart axis item below the x axis programmatically. For short text its ok. How can it be done?
Thank you.