
I have a radgrid with Allow automaticupdates but when I try it it does update the database below is my asp.net code
<%@ Page Title="" Language="VB" MasterPageFile="~/Header.master" AutoEventWireup="false" CodeFile="InvoiceSchedule.aspx.vb" Inherits="StepIII_InvoiceSchedule" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager>
<div class="Invoice">
<%-- Created a gridview that has templates --%>
<asp:SqlDataSource ID="sqlMonth" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT * FROM [lkp_Month]"></asp:SqlDataSource>
<asp:SqlDataSource ID="sqlYear" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT * FROM [lkp_Year]"></asp:SqlDataSource>
<asp:SqlDataSource ID="sqlInvoiceSource" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT SourceID as SID, Source AS invoicesource FROM lkp_InvoiceSource"></asp:SqlDataSource>
<asp:SqlDataSource runat="server" ID="sqlInvoice" ConnectionString='<%$ ConnectionStrings:COSIGrantsDB %>' SelectCommand="SELECT InvoiceSchedule_Test.Amount, lkp_Month.Month, InvoiceSchedule_Test.MonthId, InvoiceSchedule_Test.YearId, InvoiceSchedule_Test.SourceId, lkp_Year.Year, lkp_InvoiceSource.Source, InvoiceSchedule_Test.ApplicationID, InvoiceSchedule_Test.InvoiceScheduleId FROM InvoiceSchedule_Test LEFT OUTER JOIN lkp_Month ON InvoiceSchedule_Test.MonthId = lkp_Month.MonthID LEFT OUTER JOIN lkp_Year ON InvoiceSchedule_Test.YearId = lkp_Year.YearID LEFT OUTER JOIN lkp_InvoiceSource ON InvoiceSchedule_Test.SourceId = lkp_InvoiceSource.SourceID WHERE (InvoiceSchedule_Test.ApplicationID = @AppID)" InsertCommand="INSERT INTO InvoiceSchedule_Test(MonthId, YearId, Amount, SourceId, ApplicationID) VALUES (@monthid, @yearid, @amount, @sourceid, @appid)" DeleteCommand="Delete from InvoiceSchedule_test where invoicescheduleid=@invoiceid" UpdateCommand="UPDATE InvoiceSchedule_Test SET MonthId = @monthid, YearId = @yearid, Amount = @amount, SourceId = @sourceid, ApplicationID = @appid WHERE (InvoiceScheduleId = @invoiceschedid)">
<DeleteParameters>
<asp:Parameter Name="invoiceid"></asp:Parameter>
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="monthid"></asp:Parameter>
<asp:Parameter Name="yearid"></asp:Parameter>
<asp:Parameter Name="amount"></asp:Parameter>
<asp:Parameter Name="sourceid"></asp:Parameter>
<asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
</InsertParameters>
<SelectParameters>
<asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="monthid"></asp:Parameter>
<asp:Parameter Name="yearid"></asp:Parameter>
<asp:Parameter Name="amount"></asp:Parameter>
<asp:Parameter Name="sourceid"></asp:Parameter>
<asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
<asp:Parameter Name="invoiceschedid" />
</UpdateParameters>
</asp:SqlDataSource>
<telerik:RadGrid ID="rg" runat="server" AutoGenerateEditColumn="True" DataSourceID="sqlInvoice" AutoGenerateDeleteColumn="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True">
<GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
<MasterTableView DataKeyNames="InvoiceScheduleId" DataSourceID="sqlInvoice" AutoGenerateColumns="False" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" CommandItemDisplay="top">
<Columns>
<telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" SortExpression="Amount" UniqueName="Amount" DataType="System.Decimal" FilterControlAltText="Filter Amount column"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Month" HeaderText="Month" SortExpression="Month" UniqueName="Month" FilterControlAltText="Filter Month column"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="MonthId" HeaderText="MonthId" SortExpression="MonthId" UniqueName="MonthId" DataType="System.Int32" FilterControlAltText="Filter MonthId column"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="YearId" HeaderText="YearId" SortExpression="YearId" UniqueName="YearId" FilterControlAltText="Filter YearId column" DataType="System.Int32"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SourceId" HeaderText="SourceId" SortExpression="SourceId" UniqueName="SourceId" FilterControlAltText="Filter SourceId column"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Year" HeaderText="Year" SortExpression="Year" UniqueName="Year" DataType="System.Int32" FilterControlAltText="Filter Year column"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Source" FilterControlAltText="Filter Source column" HeaderText="Source" SortExpression="Source" UniqueName="Source">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ApplicationID" DataType="System.Int32" FilterControlAltText="Filter ApplicationID column" HeaderText="ApplicationID" SortExpression="ApplicationID" UniqueName="ApplicationID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="InvoiceScheduleId" DataType="System.Int32" FilterControlAltText="Filter InvoiceScheduleId column" HeaderText="InvoiceScheduleId" ReadOnly="True" SortExpression="InvoiceScheduleId" UniqueName="InvoiceScheduleId">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:radgrid>
<%-- <telerik:RadGrid ID="rg" runat="server" AutoGenerateDeleteColumn="True" allowautomaticdeletes="true" AutoGenerateEditColumn="True" DataSourceID="sqlInvoice" AllowAutomaticInserts="True" onUpdateCOmmand="rg_Update" AutoGenerateColumns="False" CellSpacing="-1" GridLines="Both" onDeleteCommand="rg_DeleteCommand" >
<MasterTableView DataKeyNames="InvoiceScheduleId" DataSourceID="sqlInvoice" commanditemdisplay="top" >
<Columns>
<telerik:GridBoundColumn HeaderText="invoiceid" datafield="invoicescheduleid"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="source" FilterControlAltText="Filter Invoicesource column" HeaderText="source" UniqueName="Invoicesource">
<EditItemTemplate>
<asp:DropDownList ID="sourceDropDownList" runat="server" DataSourceID="sqlInvoiceSource" DataTextField="invoicesource" DataValueField="sid">
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="sourceLabel" runat="server" Text='<%# Eval("source") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridDropDownColumn DataField="monthid" HeaderText="Month" uniquename="monthid" ListTextField="Month" ListValueField="monthid" datasourceid="sqlMonth"></telerik:GridDropDownColumn>
<telerik:griddropdowncolumn uniqueName="yearid" ListTextField="year" ListValueField="yearid" DataSourceID="sqlYear" HeaderText="Year" DataField="yearid"></telerik:griddropdowncolumn>
<telerik:gridboundcolumn UniqueName="amount" HeaderText="amount" Dataformatstring="{0:C}" DataField="amount"></telerik:gridboundcolumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
--%>
</div>
Can anyone tell me what I am doing wrong?
Thanks
Robin

Hi
I have Radgrid with two checkboxes and details table with checkbox in one column and repeater and checkbox in it in another column. When all items in details table is checked then radgrid checkbox should also be checked. similarly if repeater items are checked then radgrid checkbox should be checked. Please suggest how can this be acheived.
<radgrid>
<mastertableview>
<Columns>
<Gridtemplatecolumn>
<checkboxleft>
</Gridtemplatecolumn>
<Gridtemplatecolumn>
<checkboxright>
</Gridtemplatecolumn>
<detailstable>
<gridtableview>
<columns>
<<Gridtemplatecolumn>
<itemcheckboxleft>
</Gridtemplatecolumn>
<<Gridtemplatecolumn>
<repeater>
<itemcheckboxleft>
</repeater>
</Gridtemplatecolumn>
</columns>
</detailstable>
</columns>
</radgrid>
Hi,
I have a "RadWizard" with two "RadWizardSteps" and two different "ValidationGroups".
When I click the first button (BtnArrayAdd), the validation for the "TxtArrayName" control works correct.
When I click the second button (BtnAdd), the validation checks only the "TxtAttributeName" control but not the "CbAttributeType" control.
When I remove the first step, the validation for both controls (TxtAttributeName & CbAttributeType) works correct.
What could be the problem?
Thx,
Dominik
<telerik:RadWizardStep ID="StepWebServiceOutArrays" runat="server" StepType="Auto"> <br /> <div class="sbLabel1"><asp:Label ID="LblArrayName" runat="server"></asp:Label></div> <div class="sbControl1"><telerik:RadTextBox ID="TxtArrayName" runat="server" Width="200"></telerik:RadTextBox></div> <div class="sbLabel2"><asp:RequiredFieldValidator ID="TxtArrayNameValidator" runat="server" ControlToValidate="TxtArrayName" ValidationGroup="ArrayValidation" EnableClientScript="true" ForeColor="Red" ></asp:RequiredFieldValidator></div> <br /><br /><br /> <telerik:RadButton ID="BtnArrayAdd" runat="server" CssClass="system" Width="100" OnClick="E_Click" ValidationGroup="ArrayValidation"></telerik:RadButton> <telerik:RadButton ID="BtnArrayRemove" runat="server" CssClass="system" Width="100" OnClick="E_Click" CausesValidation="false"></telerik:RadButton> <br /> </telerik:RadWizardStep> <telerik:RadWizardStep ID="StepWebServiceOutAttributes" runat="server" StepType="Auto"> <br /> <div class="sbLabel1"><asp:Label ID="LblAttributeName" runat="server"></asp:Label></div> <div class="sbControl1"><telerik:RadTextBox ID="TxtAttributeName" runat="server" Width="200"></telerik:RadTextBox></div> <div class="sbLabel2"><asp:RequiredFieldValidator ID="TxtAttributeNameValidator" runat="server" ControlToValidate="TxtAttributeName" ValidationGroup="AttributeValidation" EnableClientScript="true" ForeColor="Red" ></asp:RequiredFieldValidator></div> <br /><br /> <div class="sbLabel1"><asp:Label ID="LblAttributeType" runat="server"></asp:Label></div> <div class="sbControl1"><telerik:RadComboBox ID="CbAttributeType" runat="server" Width="200"></telerik:RadComboBox></div> <div class="sbLabel2"><asp:RequiredFieldValidator ID="CbAttributeTypeValidator" runat="server" ControlToValidate="CbAttributeType" ValidationGroup="AttributeValidation" EnableClientScript="true" ForeColor="Red"></asp:RequiredFieldValidator></div> <br /><br /><br /> <telerik:RadButton ID="BtnAdd" runat="server" CssClass="system" Width="100" OnClick="E_Click" ValidationGroup="AttributeValidation"></telerik:RadButton> <telerik:RadButton ID="BtnRemove" runat="server" CssClass="system" Width="100" OnClick="E_Click" CausesValidation="false"></telerik:RadButton> <br /> </telerik:RadWizardStep>Dear Team,
I am working on some charts where some of them have more than 3 or 4 y-axis. The requirement is to set 2 y-axis on left side and remaining on right side.
Basically, we are trying to enable the user to customize their own chart where they can set orientation for each y-axis and save the option in back-end. I have tried with axis crossing points but it is pushing all additional y-axis to the right side.
Any example / guidance is appreciated.
I have a grid that is in edit mode an update delete command in grid.
I have some textboxes (for name, surname etc) and and a radgrid on my web page.(for products for example). all radgrid's rows are in "inplace" edit mode
I want to use the 'Add new Record' on the RadGrid and then with an external button want to save it to database.
Used the link as reference : https://www.telerik.com/forums/update-radgrid-with-external-button-(all-rows-in-edit-mode)
hi,
I'm trying to figure out how to add a clickable hyperlink to a cell, currently I receive the contents from a SQL backend, check if the value contains a link and add it as a cell.Link, it currently shows them as links but they are not clickable, what pony trick am i missing? thanks for you advise. ps: this is in C#
kind regards, iwan
I have a Grid where I select a row. When I select a row I want to capture the email address that's displayed in the Grid. I typically use a SqlDataSource as the data source for my Grids and don't have any trouble getting the value from a cell on a selected row, but this time I had to use a DataTable. Please help me modify my code so that I may capture the email address from the selected row on the Grid.
Here is the Grid markup:
<telerik:RadGrid ID="rgAdUsrs" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" ShowGroupPanel="true" Skin="Office2010Black" OnSelectedIndexChanged="rgAdUsrs_SelectedIndexChanged" GroupingSettings-CaseSensitive="false"> <ClientSettings AllowDragToGroup="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true"></ClientSettings> <MasterTableView> <PagerStyle PageSizes="10, 25, 50, 100, 250, 400" AlwaysVisible="true" /> <Columns> <telerik:GridButtonColumn ButtonType="LinkButton" Text="Select" CommandName="Select"></telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="givenName" HeaderText="First Name" SortExpression="givenName" UniqueName="givenName" FilterControlAltText="Filter givenName column" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="sn" HeaderText="Last Name" SortExpression="sn" UniqueName="sn" FilterControlAltText="Filter sn column" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="mail" HeaderText="Email" SortExpression="mail" UniqueName="mail" FilterControlAltText="Filter mail column" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="department" HeaderText="Department" SortExpression="department" UniqueName="department" FilterControlAltText="Filter department column" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="manager" HeaderText="Manager" SortExpression="manager" UniqueName="manager" FilterControlAltText="Filter manager column" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid>
Here is the code behind for the SelectedIndexChanged event:
protected void rgAdUsrs_SelectedIndexChanged(object sender, EventArgs e) { foreach (GridDataItem item in rgAdUsrs.SelectedItems) { repidtxttest.Text = item["mail"].Text; hdnRepId.Value = item["mail"].Text; hdnRepGivenName.Value = item["givenName"].Text; hdnRepSn.Value = item["sn"].Text; hdnRepDept.Value = item["department"].Text; hdnRepsMgr.Value = item["manager"].Text; } }
Here is the code from the data table:
DataTable dt = new DataTable(); dt.Columns.AddRange(new DataColumn[5] { new DataColumn("givenName", typeof (string)), new DataColumn("sn", typeof (string)), new DataColumn("mail", typeof (string)), new DataColumn("department", typeof (string)), new DataColumn("manager", typeof (string)) }); using (var context = new PrincipalContext(ContextType.Domain, null)) { using (var group = (GroupPrincipal.FindByIdentity(context, "Group1"))) { var users = group.GetMembers(true); foreach (UserPrincipal user in users) { DirectoryEntry de = user.GetUnderlyingObject() as DirectoryEntry; dt.Rows.Add ( Convert.ToString(de.Properties["givenName"].Value), Convert.ToString(de.Properties["sn"].Value), Convert.ToString(de.Properties["mail"].Value), Convert.ToString(de.Properties["department"].Value), Regex.Replace((Convert.ToString(de.Properties["manager"].Value)), @"CN=([^,]*),.*$", "$1") ); } rgAdUsrs.DataSource = dt; rgAdUsrs.DataBind(); } }

| //this throws and error : Insert item is available only when grid is in insert mode. protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { |
| e.Item.OwnerTableView.IsItemInserted = false; |
| RadGrid1.Rebind(); |
| } |
| //this had no effect |
| protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { |
| e.Cancelled = true; |
| RadGrid1.Rebind(); |
| } |
| // nothing on edit either |
| protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgse) { |
| RadGrid1.MasterTableView.ClearEditItems(); |
| RadGrid1.Rebind(); |
| } |
// some additional background info:
I have tried it in forms & popup and with a user control and not
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| GridLines="None" |
| AllowPaging="True" |
| PageSize="10" |
| AllowAutomaticDeletes="True" |
| AllowAutomaticInserts="True" |
| AllowAutomaticUpdates="True" |
| AutoGenerateColumns="False" |
| OnItemDataBound="RadGrid1_ItemDataBound" |
| OnInsertCommand="RadGrid1_InsertCommand" |
| OnUpdateCommand="RadGrid1_UpdateCommand" |
| OnDeleteCommand="RadGrid1_DeleteCommand" |
| OnNeedDataSource="RadGrid1_NeedDataSource"> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <MasterTableView Width="950" CommandItemDisplay="TopAndBottom" DataKeyNames="PromoCode" EditMode="EditForms" > |
| <Columns> |
| <telerik:GridTemplateColumn> |
| <ItemTemplate> |
| <asp:ImageButton ID="Button1" runat="server" ImageUrl="~/App_Themes/Default/Images/EditButton.gif" |
| Text="Edit" CommandName="Edit" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="PromoCode" SortExpression="PromoCode" UniqueName="PromoCode"> |
| <ItemTemplate> |
| <asp:Label runat="server" ID="lblPromoCode" Text='<%# Eval("PromoCode") %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:TextBox runat="server" ID="tbxPromoCode" EnableViewState="true" ></asp:TextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="tbxPromoCode" |
| ErrorMessage="*" runat="server"> |
| </asp:RequiredFieldValidator> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridButtonColumn ConfirmText="Delete this Item?" ConfirmDialogType="RadWindow" |
| ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" |
| UniqueName="DeleteColumn"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
Page.Response.Redirect does work but it is not an option. lol
I am having a hard time getting the Legend label values to equal the pie series NameField values.
<telerik:RadHtmlChart ID="rhcDiscountReasons" runat="server" DataSourceID="sqlDRRAlt" ChartTitle-Text="Discount Reasons">
<ChartTitle Text="Discount Reasons">
<Appearance Visible="True">
</Appearance>
</ChartTitle>
<Legend>
<Appearance Visible="True" BackgroundColor="WindowFrame" Align="Center" Position="Bottom" Orientation="Horizontal">
<TextStyle Color="White" FontSize="18" />
</Appearance>
<Item Visual="legendItemVisual" />
</Legend>
<PlotArea>
<Series>
<telerik:PieSeries DataFieldY="dtypecount" Name="Discount Reasons" VisibleInLegend="true" NameField="dtype">
<LabelsAppearance DataField="dtype">
</LabelsAppearance>
</telerik:PieSeries>
</Series>
</PlotArea>
</telerik:RadHtmlChart>
If I use the below code, It fills all the legend labels with "Discount Reasons", I want them to have the NameField values. I have tried everything I could think of to access those values but cannot. If I replace e.series.name with e.series.categoryField the legend lables all say "dtype", this is close but I want the dtype value.
var label = new drawing.Text(e.series.name, [0, 0], {
fill: {
color: legendLabelsColor
}
})
Can someone point me in the right direction?
