i already purchage your tool
my question is
1)how to replace igedit_getById('<%=stdFeeWebCurrencyEdit.ClientID%>') in javascript
2)stdFeeWebCurrencyEdit.getValue(); in javascript
3)stdFeeWebCurrencyEdit.setValue(0) in javascript
on
<ig:WebCurrencyEditor ID="enFeeWebCurrencyEdit" runat="server" CssClass="normalText" MinValue="0" Nullable="False" Width="100px" MaxValue="100000"> </ig:WebCurrencyEditor> control on version 15.1
please help width code
thanks.
please also tell me how to replace
enFeeWebCurrencyEdit.setEnabled(true);
in version 15.1
thanks
Hello,
Thank you for contacting Infragistics!
We received your support request concerning converting to v15.1 WebCurrencyEditor, and this case has been assigned to me. I have done an initial review of your case and first to find the control in JavaScript you can do the following:
var curEdit = $find(“<%=WebCurrencyEditor1.ClientID%>”);
To get/set the value you would use get_value and set_value:
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=WebTextEditor~Infragistics.Web.UI.WebNumericEditor~value.html
var value = curEdit.get_value();curEdit.set_value(0);
For enabling you would use set_enabled:
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=WebTextEditor~Infragistics.Web.UI.WebTextEditor~enabled.html
curEdit.set_enabled(true);
You can see the following links for further documentation and samples concerning this control:
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=Web_WebCurrencyEditor.html
http://www.infragistics.com/samples/aspnet/editors/webcurrencyeditor
Please let me know if you have any further questions concerning this matter.
thanks for reply
One more question
this is my old code to bind grid
Please tell me how it is use in ig:WebDataGrid 15.1
int recordCount = 0;
TextBox txtRepName = (TextBox)Utils.Helper.FindControl(this.Page, "txtRepName"); txtRepName.Focus(); strRepName = (txtRepName.Text).ToString() == "" ? null : txtRepName.Text; // Set Paging Information. listWebGrid.DisplayLayout.Pager.PageSize = gridDefaultPageSize; int pageSize = listWebGrid.DisplayLayout.Pager.PageSize; int pageNo = listWebGrid.DisplayLayout.Pager.CurrentPageIndex;
// Set Sort Order. string sortOrder = (SortOrder == SortIndicator.Descending) ? Constants.Ascending : Constants.Descending;
DataTable dtRepresentatives = BLUser.GetAllRepsByPaging(false, strRepName, pageNo, pageSize, SortField, sortOrder, out recordCount).Tables[0]; listWebGrid.DataSource = dtRepresentatives; listWebGrid.DataBind(); listWebGrid.DisplayLayout.Pager.PageCount = Convert.ToInt32(Math.Ceiling(recordCount * 1.0 / pageSize));
//If pagecount is 0 the pager should display Page 1 of 1 instead //of Page 1 of 0 if (listWebGrid.DisplayLayout.Pager.PageCount == 0) listWebGrid.DisplayLayout.Pager.PageCount = 1;
thnaks
Thank you for the update. For Paging and sorting these features are now done through behaviors. You can see the following documentation to see how to set them up:
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=WebDataGrid_Paging.html
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=WebDataGrid_Sorting.html
You can see the following link for other behaviors of the grid:
http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=WebDataGrid_Behaviors.html
Setting a datasouce is going to be simuliar for example on one of my current samples this is how I bind the grid to a datatable in page load, where GetEmployees returns a datatable full of employees:
if (Session["GridData"] == null) { Session["GridData"] = GetEmployees(50); WebDataGrid1.DataSource = Session["GridData"]; WebDataGrid1.DataBind(); } else { WebDataGrid1.DataSource = Session["GridData"]; }
how to add new row on
ig:WebDataGrid
please give me code
Are you trying to add the row on the client side or server side? If you are adding it to your server you have to add it to your datasource then bind that datasource to your grid. If you are adding it on the client you can see the following forum threads:
http://www.infragistics.com/community/forums/t/20029.aspx
http://www.infragistics.com/community/forums/t/93139.aspx
http://www.infragistics.com/community/forums/t/91020.aspx
thanks for help
how to add one row ,2 row, 3 row on three time add buttion click
i found error
Uncaught Rows must have unique DataKeys. This key appears more than once:
<ig:WebDataGrid ID="listWebGrid" Width="99%" StyleSetName="Office2007Black" runat="server" AutoGenerateColumns="false" DataKeyFields="MiscFeeId">
<Columns>
<ig:BoundDataField DataFieldName="MiscItem" Key="Description" Header-Text="Rep Name"></ig:BoundDataField><ig:BoundDataField DataFieldName="Fee" Key="Fee" Header-Text="Amount"></ig:BoundDataField>
<ig:BoundDataField DataFieldName="MiscFeeId" Key="MiscFeeId" Hidden="True" Header-Text="Description"></ig:BoundDataField></Columns>
<Behaviors><ig:Sorting SortingMode="Single" Enabled="true"></ig:Sorting><ig:Paging PagerMode="NumericFirstLast" PageSize="10" QuickPages="4" Enabled="true"></ig:Paging><ig:Selection RowSelectType="Multiple" CellClickAction="Row"></ig:Selection><ig:EditingCore BatchUpdating="true"><Behaviors><%-- <ig:RowAdding Enabled="true" ></ig:RowAdding>--%><ig:RowEditing Enabled="true"></ig:RowEditing></Behaviors></ig:EditingCore></Behaviors></ig:WebDataGrid>
<input type="button" onclick="AfterRowInsertEventHandler();" />
------------------
function AfterRowInsertEventHandler() { var theGrid = $find("<%= listWebGrid.ClientID %>"); var rows = theGrid.get_rows(); var rowsLength = theGrid.get_rows().get_length(); // var row = ["IsSelected", "MiscItem", "Fee", "MiscFeeId"]; rows.add({ "IsSelected": "", "MiscItem": "", "Fee": "", "MiscFeeId": document.getElementById("hdnCertNo").value }); document.getElementById("hdnCertNo").value += document.getElementById("hdnCertNo").value + 1; // var lastRow = rows.get_row(rowsLength); // var cell = lastRow.get_cell(1); // rows.add(lastRow); //theGrid.get_rows().add({ "MiscFeeId": "hello" }); // object of columnKey:cellValue
}
Thank you for the update. To add multiple rows at once on the client side you will want to have BatchUpdating off the EditingCore set to true. This will allow you to do multiple updates/adds/deletes at a time. It appears you already have this set to true. As for why you are getting the error it is because the rows you are adding do not have a unique value for the column/cell that is the DataKeyField. Your current DataKeyField is set to “MiscFeeId”, you have to make sure that has a unique value for every cell in that column of the grid otherwise it will continue to throw that error.
thanks for support
How to update add new row value from code behind to database.
Hello, To update the database you would handle the RowUpdating/RowAdding/RowDeleting server events, those event will provide with the information in the row. Then you would send that to your database using the add/delete/update statements/method of your database.
what is different between 15.1.20151.2278 and 15.1.20151.2123 for WebDataGrid
actually i implemented add multiple row and insert to db. i successfully inserted in 15.1.20151.2123 version
but it is not working on 15.1.20151.2278 version
my code is
<ig:WebDataGrid ID="uwgPayments" ShowFooter="true" ViewStateMode="Enabled" EnableViewState="true" OnRowAdded="uwgPayments_RowAdded" OnRowAdding="uwgPayments_RowAdding" OnRowUpdated="uwgPayments_RowUpdated" OnRowUpdating="uwgPayments_RowUpdating" EnableAjaxViewState="true" EnableDataViewState="true" EnableAjax="true" Width="99%" DataKeyFields="PaymentId" StyleSetName="Office2007Black" runat="server" AutoGenerateColumns="false"> <Columns> <ig:BoundDataField DataFieldName="PaymentId" Key="PaymentId" Hidden="True" Header-Text="Pay ID"></ig:BoundDataField> <ig:BoundDataField DataFieldName="CertId" Key="CertId" Hidden="True" Header-Text="Cert No"></ig:BoundDataField> <ig:BoundDataField DataFieldName="PaymentAmt" Key="PaymentAmt" DataFormatString="{0:c}" Header-Text="Amount"></ig:BoundDataField> <ig:BoundDataField DataFieldName="PaymentType" Key="PaymentType" Header-Text="Payment Type" Width="120px"></ig:BoundDataField> <ig:BoundDataField DataFieldName="PaymentDate" Key="PaymentDate" DataFormatString="{0:MM/dd/yyyy HH:mm}" Width="120px" DataType="System.DateTime" Header-Text="Date"></ig:BoundDataField> <ig:BoundDataField DataFieldName="StandardFee" Key="StandardFee" DataFormatString="{0:c}" Header-Text="Std Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="ChildFee" Key="ChildFee" DataFormatString="{0:c}" Header-Text="Child Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="ExtraNightFee" Key="ExtraNightFee" DataFormatString="{0:c}" Header-Text="ExN Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="MiscFee" Key="MiscFee" DataFormatString="{0:c}" Header-Text="Misc. Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="RescheduleFee" Key="RescheduleFee" DataFormatString="{0:c}" Header-Text="Res. Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="RenewalFee" Key="RenewalFee" DataFormatString="{0:c}" Header-Text="Ren. Fee"></ig:BoundDataField> <ig:BoundDataField DataFieldName="AssocTransId" Key="AssocTransId" Width="90px" Header-Text="Assoc Trans Id"></ig:BoundDataField> </Columns> <Behaviors> <ig:Activation Enabled="true"></ig:Activation> <ig:Sorting></ig:Sorting> <%-- <ig:Paging PagerMode="NumericFirstLast" PageSize="10" QuickPages="4" Enabled="true"> </ig:Paging>--%> <ig:Selection RowSelectType="Single" CellClickAction="Row"></ig:Selection> <ig:EditingCore AutoCRUD="false" > <Behaviors> <%-- <ig:RowDeleting Enabled="true" ShowDeleteButton="true"></ig:RowDeleting>--%> <%-- <ig:RowEditing Enabled="true" RowEditingClientEvents-ExitingEditMode="WebDataGrid1_RowEdit_ExitingEditMode" EnableDialog="false" EditModeActions-EnableOnActive="true" EditModeActions-MouseClick="Single"> </ig:RowEditing>--%>
<ig:CellEditing Enabled="true" EditModeActions-EnableOnActive="true" EditModeActions-MouseClick="Single"> <ColumnSettings > <ig:EditingColumnSetting ColumnKey="PaymentType" EditorID="PaymentTypeProvider" /> <ig:EditingColumnSetting ColumnKey="PaymentDate" EditorID="PaymentDateProvider" /> <ig:EditingColumnSetting ColumnKey="PaymentAmt" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="StandardFee" EditorID="StandardFeeEditorProvider" /> <ig:EditingColumnSetting ColumnKey="ChildFee" EditorID="ChildFeeEditorProvider" /> <ig:EditingColumnSetting ColumnKey="ExtraNightFee" EditorID="ExtraNightFeeEditorProvider" /> <ig:EditingColumnSetting ColumnKey="MiscFee" EditorID="MiscFeeEditorProvider" /> <ig:EditingColumnSetting ColumnKey="RescheduleFee" EditorID="RescheduleFeeEditorProvider" /> <ig:EditingColumnSetting ColumnKey="RenewalFee" EditorID="RenewalFeeEditorProvider" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> <EditorProviders> <ig:DateTimeEditorProvider ID="PaymentDateProvider"> <EditorControl ClientIDMode="Predictable" runat="server" DisplayModeFormat="MM/dd/yyyy HH:mm" EditModeFormat="MM/dd/yyyy HH:mm"> <Buttons SpinButtonsDisplay="OnRight"></Buttons> </EditorControl> </ig:DateTimeEditorProvider> <ig:DropDownProvider ID="PaymentTypeProvider"> <EditorControl ID="EditorControl2" runat="server" DisplayMode="DropDownList" AutoPostBack="false"> <Items>
<ig:DropDownItem Value="Mail In Check" Text="Mail In Check"></ig:DropDownItem> <ig:DropDownItem Value="Checks By Phone" Text="Checks By Phone"></ig:DropDownItem> <ig:DropDownItem Value="Credit Card" Text="Credit Card"></ig:DropDownItem> <ig:DropDownItem Value="Rebate Check" Text="Rebate Check"></ig:DropDownItem>
</Items> </EditorControl> </ig:DropDownProvider> <ig:CurrencyEditorProvider ID="StandardFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal"> </ig:CurrencyEditorProvider> <ig:CurrencyEditorProvider ID="ChildFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal"> </ig:CurrencyEditorProvider> <ig:CurrencyEditorProvider ID="ExtraNightFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal"> </ig:CurrencyEditorProvider> <ig:CurrencyEditorProvider ID="MiscFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal" > </ig:CurrencyEditorProvider> <ig:CurrencyEditorProvider ID="RescheduleFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal"> </ig:CurrencyEditorProvider> <ig:CurrencyEditorProvider ID="RenewalFeeEditorProvider" EditorControl-ClientEvents-Blur="CalculateRowTotal"> </ig:CurrencyEditorProvider> </EditorProviders> </ig:WebDataGrid>
function AfterRowInsertEventHandler() { var grid = $find(uwgPayments); var rows = grid.get_rows(); var rowsLength = grid.get_rows().get_length(); var row = new Array("0", "0"); rows.add(row); }
---
protected void uwgPayments_RowAdding(object sender, RowAddingEventArgs e) { if (ViewState["i"] == null) ViewState["i"] = i; else { i = (int)ViewState["i"] + 1; ViewState["i"] = i; } DataRow row = ((DataTable)ViewState["dtPayments"]).NewRow(); row.SetField<Int32>("PaymentId", -i); row.SetField<Int32>("CertId", certId); row.SetField<string>("PaymentAmt", "0.00");
row.SetField<Int32>("PaymentTypeId", 0); row.SetField<DateTime>("PaymentDate", DateTime.Now); row.SetField<string>("StandardFee", "0.00");
row.SetField<string>("ChildFee", "0"); row.SetField<string>("ExtraNightFee", "0.00"); row.SetField<string>("MiscFee", "0.00");
row.SetField<string>("RescheduleFee", "0.00"); row.SetField<string>("RenewalFee", "0.00"); row.SetField<string>("AssocTransId", "");
((DataTable)ViewState["dtPayments"]).Rows.Add(row); RebindGrid(); } public void RebindGrid() { uwgPayments.DataSource = ((DataTable)ViewState["dtPayments"]); uwgPayments.DataBind(); } protected void uwgPayments_RowUpdated(object sender, RowUpdatedEventArgs e) { e.ExceptionHandled = true; } protected void uwgPayments_RowUpdating(object sender, RowUpdatingEventArgs e) { DataTable dt = (DataTable)ViewState["dtPayments"]; int Index = e.RowID.Index;
int paymentTypeId = 0; if (e.Values["PaymentType"].ToString() == "Mail In Check") { paymentTypeId = 1; } else if (e.Values["PaymentType"].ToString() == "Checks By Phone") { paymentTypeId = 2; } else if (e.Values["PaymentType"].ToString() == "Credit Card") { paymentTypeId = 3; }
dt.Rows[Index]["PaymentId"] = e.Values["PaymentId"] == null ? -1 : e.Values["PaymentId"]; dt.Rows[Index]["CertId"] = certId; dt.Rows[Index]["PaymentAmt"] = e.Values["PaymentAmt"]; dt.Rows[Index]["PaymentTypeId"] = paymentTypeId; dt.Rows[Index]["PaymentDate"] = e.Values["PaymentDate"]; dt.Rows[Index]["StandardFee"] = e.Values["StandardFee"]; dt.Rows[Index]["ChildFee"] = e.Values["ChildFee"]; dt.Rows[Index]["ExtraNightFee"] = e.Values["ExtraNightFee"]; dt.Rows[Index]["MiscFee"] = e.Values["MiscFee"]; dt.Rows[Index]["RescheduleFee"] = e.Values["RescheduleFee"]; dt.Rows[Index]["RenewalFee"] = e.Values["RenewalFee"]; dt.Rows[Index]["AssocTransId"] = e.Values["AssocTransId"]; //.. dt.Rows[Index]["PaymentAmt"] = Convert.ToDecimal(e.Values["PaymentAmt"]); // dt.Rows[Index]["PaymentAmt"] = Convert.ToDecimal(e.Values["PaymentAmt"]);
ViewState["dtPayments"] = dt; dsPayments.Tables[0].Rows.Add(new object[] { e.Values["PaymentId"]==null?-1:e.Values["PaymentId"] ,certId ,e.Values["PaymentAmt"] ,paymentTypeId ,e.Values["PaymentDate"] ,e.Values["StandardFee"] ,e.Values["ChildFee"] ,e.Values["ExtraNightFee"] ,e.Values["MiscFee"] ,e.Values["RescheduleFee"] ,e.Values["RenewalFee"] ,e.Values["AssocTransId"] }); }
protected void uwgPayments_RowAdded(object sender, RowAddedEventArgs e) { e.ExceptionHandled = true; }
----------
if (!IsPostBack) { DataSet dsTemp = BLPayment.GetClientPaymentsByCertId(WebProfile.Current.UserId, certId); WebDataGrid uwgPayments = (WebDataGrid)Helper.FindControl(Page, "uwgPayments"); uwgPayments.DataSource = dsTemp; uwgPayments.DataBind(); ViewState["dtPayments"] = dsTemp.Tables[0]; if (dsTemp.Tables[0].Rows.Count > 0) //CertNo already available { hdnCertNo.Value = Helper.GetString(dsTemp.Tables[0].Rows[0], 2); } else { hdnCertNo.Value = BLTraveler.GetClientInfo(certId, WebProfile.Current.UserId).Tables["CertificateInfo"].Rows[0]["CertNo"].ToString(); } Page.Title = "Client Payments - " + hdnCertNo.Value; } else { dsPayments = new DataSet(); dsPayments.DataSetName = "PaymentsDataset"; DataTable dt = dsPayments.Tables.Add("Payment"); dt.Columns.Add("PaymentId"); dt.Columns.Add("CertId"); dt.Columns.Add("PaymentAmt"); dt.Columns.Add("PaymentTypeId"); dt.Columns.Add("PaymentDate"); dt.Columns.Add("StandardFee"); dt.Columns.Add("ChildFee"); dt.Columns.Add("ExtraNightFee"); dt.Columns.Add("MiscFee"); dt.Columns.Add("RescheduleFee"); dt.Columns.Add("RenewalFee"); dt.Columns.Add("AssocTransId"); }
i insert two row to grid and insert to database it is not working in new version