I'm trying to find the best way to configure my radgrid to accomplish this scenario.
Here is the scenario:
(This all occurs within my Default.aspx page)
1. A radtextbox control prompts the user to input the customer number. The customer number is validated using data coming from a table adapter.
2. I want to pass the customer number entered above into another query (table adapter) and return a item details dataset using it. This is the dataset
that I want my RadGrid connected to.
-------------------
I have been able to figure out how to accomplish everything above by using the RadGrid (onneeddatasource) event.
Here is where my problem comes in:
---------------------
3. One of the columns in my item details dataset (column name PRINT) is a Boolean datatype. I have set the PRINT column in my datatable associated with the table adapter to read-only = false. I need to give the user ability to (check or un-check) that column in my RadGrid and have it update the datatable only. I have no requirement to go back and update the SQL database with the updated datatable. This data is going to be used to generate a sql report which is included in this project.
In summary, I haven't been able to find a way to query and store results in a local datatable and allow the radgrid to update that local datatable. I've looked at the batch editing capability, but I don't like the way it requires having to press the save button in between paging. I'd like to code it so that the user can click the check box and it immediately saves the result to the data table.
Is there anyone out there that can give me some advice or an example of how I can accomplish this problem?
Hi,
I am trying to add a custom filter option under default filter, in my grid there are two columns will use default filter, and others will be under FilterTemplate
1. newly added custom filter option called "Large Losses" will be added to both of columns filter. I donot want. (I used js to invisible the one).
2. my Large Losses custom option is working with expression. but the issue is that after my Large Losses option is applied to the grid, I apply another filter option to the grid from another column, the Large Losses filter is gone, only the one applied after it shown in the grid. The other way around, If I apply other filter option first, then apply my Large Losses on top of it, it works fine, both filter result under AND shown in the grid.
3. Please help, while I debugging the code, found that my Large Losses expression is not kept when I apply another filter on top of it.
aspx:
<telerik:GridNumericColumn UniqueName="totalincurred" HeaderText="Incurred" DataField="totalincurred" Aggregate="Sum"
AllowFiltering="true" DataType="System.Decimal" FilterControlWidth="80px" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" DataFormatString="{0:N}">
</telerik:GridNumericColumn>
C#:
protected void LossesGrid_Init(object sender, EventArgs e)
{
GridFilterMenu filterMenu = LossesGrid.FilterMenu;
RadMenuItem menuItem = new RadMenuItem();
menuItem.Text = "Large Losses";
menuItem.Value = "LargeLosses";
LossesGrid.FilterMenu.Items.Add(menuItem);
filterMenu.ItemClick += new RadMenuEventHandler(filterMenu_ItemClick);
}
protected void filterMenu_ItemClick(object sender, RadMenuEventArgs e)
{
GridFilteringItem filterItem = LossesGrid.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
filterItem.FireCommandEvent("Filter", new Pair(e.Item.Value, e.Item.Attributes["totalincurred"]));
}
protected void LossesGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.FilterCommandName)
{
AOId = (this.Master as Main).AccountOverviewId;
VersionNo = (this.Master as Main).VersionNumber();
Pair filterPair = (Pair)e.CommandArgument;
if (filterPair.First.ToString() == "LargeLosses")
{
e.Canceled = true;
string newFilter = "(totalincurred >= 25000)";
if (LossesGrid.MasterTableView.FilterExpression == "")
{
LossesGrid.MasterTableView.FilterExpression = newFilter;
}
else
{
LossesGrid.MasterTableView.FilterExpression = "((" + LossesGrid.MasterTableView.FilterExpression + ") AND (" + newFilter + "))";
}
LossesGrid.Rebind();
}
}
}
<Columns> <telerik:GridBoundColumn DataField="PlayerLayoutID" DataType="System.Int64" FilterControlAltText="Filter PlayerLayoutID column" HeaderText="PlayerLayoutID" ReadOnly="True" SortExpression="PlayerLayoutID" UniqueName="PlayerLayoutID" Visible="False"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="LayoutTypeID" FilterControlAltText="Filter LayoutTypeID column" HeaderText="Layout Type" UniqueName="LayoutTypeID"> <EditItemTemplate> <telerik:RadComboBox ID="LayoutTypeIDRadComboBox" runat="server" DataSourceID="ODSLayoutTypes" DataTextField="TypeName" DataValueField="TypeID" onselectedindexchanged="LayoutTypeIDRadComboBox_SelectedIndexChanged" AutoPostBack="True" SelectedValue='<%# Bind("LayoutTypeID") %>' Culture="de-DE"> <Items> <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" /> </Items> </telerik:RadComboBox> <asp:RequiredFieldValidator ID="RequiredFieldValidatorLayoutType" runat="server" ErrorMessage="*" ControlToValidate="LayoutTypeIDRadComboBox" Display="Dynamic"></asp:RequiredFieldValidator> <asp:CustomValidator ID="CustomValidatorLayoutType" runat="server" ErrorMessage="*" ControlToValidate="LayoutTypeIDRadComboBox" Display="Dynamic" onservervalidate="CustomValidatorLayoutType_ServerValidate" ></asp:CustomValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LayoutTypeIDLabel" runat="server" Text='<%# Eval("TypeName") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="LayoutID" FilterControlAltText="Filter column1 column" HeaderText="Layout" UniqueName="LayoutID"> <EditItemTemplate> <telerik:RadComboBox ID="LayoutIDRadComboBox" runat="server" Culture="de-DE" Width="300px" Height="300px" OnClientDropDownOpened="OnClientDropDownOpenedHandler" ExpandAnimation-Type="None" CollapseAnimation-Type="None" > <ItemTemplate> <div id="div1" onclick="StopPropagation(event);"> <telerik:RadTreeView ID="RTVLayouts" runat="server" onnodedatabound="RTVLayouts_NodeDataBound" OnClientNodeClicking="nodeClicking" > </telerik:RadTreeView> </div> </ItemTemplate> <Items> <telerik:RadComboBoxItem Text="" /> </Items> </telerik:RadComboBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="LayoutIDLabel" runat="server" Text='<%# Eval("LayoutName") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" FilterControlAltText="Filter EditCommandColumn column" HeaderText="<%$ Resources:BasicSettings, Edit %>"></telerik:GridEditCommandColumn><telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="<%$ Resources:BasicSettings, ConfirmDelete %>" HeaderText="<%$ Resources:BasicSettings, Delete %>" Text="Delete" UniqueName="DeleteColumn"></telerik:GridButtonColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="makeObjects" FilterControlAltText="Filter MakeObjects column" HeaderText="Objects" ImageUrl="../images/symbols/settings_16.png" Text="Objects" UniqueName="MakeObjects"> </telerik:GridButtonColumn></Columns>protected void RadGridPlayerLayout_ItemCommand(object sender, GridCommandEventArgs e){ ... if (e.CommandName == "makeObjects") { GridDataItem item = (GridDataItem)e.Item; string test = item["LayoutTypeID"].Text; }}<telerik:GridTemplateColumn HeaderText="Account" UniqueName="Account"> <ItemTemplate> <div> <asp:DropDownList ID="ddlAccountLookup" Visible="false" runat="server"> </asp:DropDownList> <asp:Label ID="grdAccountName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AccountName") %>' /><br /> <asp:Label ID="grdPhone" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Phone") %>' /><br /> <asp:Label ID="grdEmail" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Email") %>' /> </div> </ItemTemplate> <HeaderStyle CssClass="BigNormalBold" HorizontalAlign="Left" VerticalAlign="Bottom" /> <ItemStyle CssClass="Normal" /></telerik:GridTemplateColumn>Hello
Support,
Currently
we are using trial version of telerik.
We
have Telerik reports, grids and charts in our application
We
want to purchase the Telerik license for the application.
Could
you please assist which product we should buy to fullfill our
requirements and what is the process to buy the license.
Thanks and Regards
Sandip Katore
Hiiii,
We have a Tree view and clicking "+" uses the web service . How to call the web service explicitly to expand that node and get it selected .
<telerik:RadTreeView ID="RadTreeViewBottom" runat="server" PersistLoadOnDemandNodes="false" RegisterWithScriptManager="true"
LoadingStatusPosition="None" OnClientNodeClicked="RadTreeViewBottom_ClientNodeClicked"
OnClientKeyPressing="RadTreeViewBottom_ClientKeyPressing" EnableViewState="false"
OnClientNodePopulating="RadTreeViewBottom_ClientNodePopulating"
OnClientLoad="RadTreeViewBottom_OnClientLoad"
OnClientNodeDataBound="NodeDataBound" OnClientNodeExpanded="Expanded"
Style="white-space: normal;">
<WebServiceSettings Method="ViewerBottom_GetNodesChildren" Path="~/ScriptServices/ScriptService.asmx" />
<Nodes>
<telerik:RadTreeNode Text="ExistingNode" Visible="True"/>
</Nodes>
</telerik:RadTreeView>
Below one is the Webmethod which i use to call in the web service
[WebMethod(EnableSession=true)]
public RadTreeNodeData[] ViewerBottom_GetNodesChildren(RadTreeNodeData node, object context)
{
IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;
int topID = int.Parse(contextDictionary["TopID"].ToString());
string type = contextDictionary["Type"].ToString();
int parentID = 0;
if (node != null)
parentID = int.Parse(node.Value);
object[] parms = new object[3];
parms[0] = (int)topID;
parms[1] = type;
parms[2] = parentID;
global::Viewer.ViewerService.Outline outline = (ViewerService.Outline)Data.WebServiceDataProvider.GetData(Data.ViewerClientServiceWrapper.MethodName.getOutline, parms);
ViewerService.OutlineItem[] outlineItems = outline.ChildItems;
List<RadTreeNodeData> result = new List<RadTreeNodeData>();
foreach (ViewerService.OutlineItem item in outlineItems)
{
RadTreeNodeData nodeData = new RadTreeNodeData();
nodeData.Text = item.Title;
nodeData.Value = item.Id.ToString();
nodeData.Attributes.Add("DocID", item.DocumentId);
if (item.HasChildren)
nodeData.ExpandMode = TreeNodeExpandMode.WebService;
result.Add(nodeData);
}
return result.ToArray();
}
Below is my JS 1183 is parent node and 1185 is the child node.
var node1 = parentNode.findNodeByValue("1183");
if (node1 == null)
return;
else {
node1.expand();
var node2 = parentNode.findNodeByValue("1185");
if (node2 != null) {
node2.select();
}
in JS here node2 returns me null i think because I'm not able to Call the Webservice ecplicitly can anyone suggest me ? how to call it programatically .