Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
200 views
Hi,

I want to create a combobox filter control instead of a textbox in RadFilter. I followed the steps described on this link:

http://www.telerik.com/community/forums/aspnet-ajax/filter/error-when-building-custom-radfilterdatafieldeditor.aspx

However the example on this link does not involve updating a a radgrid but only displaying result filter. Please help me fill in the codes (???) below so I can filter my Radgrid based on the expression produced by the ApplyExpression event:

protected void RadFilter1_ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
        {
            RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();
            provider.ProcessGroup(e.ExpressionRoot);
            RadGrid1.DataSource = ???
        }


Thanks a lot.
Pavlina
Telerik team
 answered on 08 Oct 2010
1 answer
69 views
Hello,

I was looking for a good tutorial or walktrough documentation with a real or similar example of a business application.
I've found several examples of Telerik ASP.Net controls and separate several examples of OpenAccess but not a real case of an application integrating both product and that could help me like a beginner in this area.

I'm speaking about to create a good design application (data tier, business tier, etc.)

Anybody know a good walktrough for this?
Thank you very much in advanced
Jose
Sebastian
Telerik team
 answered on 08 Oct 2010
3 answers
1.1K+ views
I am new to Rad controls there is a simple problem i am facing.

My scenario

I have to generate columns dynamically on the basis of the data coming from db.
in that in every column header there has to have a check box.


I have done that , but the thing is that there is a button outside rad grdi in which i have to find the check box
and depending upon its checked status i have to perform some business logic.

how to find the check box(located  in header) on the button click some code snippets will be helpful.
Pavlina
Telerik team
 answered on 08 Oct 2010
1 answer
145 views
I have a Column thats a DateTime Column. I want to filter by the Day of the week. Of course if i keep the column as a DateTime column i get an error about 'Thu' not being a valid datetime format.

I tried making it a regular DataBound column with a DataFormat string but still no luck. My filtering is being done via JS

Heres the code located in my User Control

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AvailableClasses.ascx.vb"
    Inherits="UserControls_AvailableClasses" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<table>
    <tr>
        <th align="right">
            City:
        </th>
        <td align="left">
            <telerik:RadComboBox ID="ddlLocationCities" Width="100%" Skin="Web20" AllowCustomText="true"
                EmptyMessage="--Select A City--" MarkFirstMatch="true" Filter="StartsWith" runat="server"
                Sort="Ascending" OnClientSelectedIndexChanged="LocationCityIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem Text="All" />
                </Items>
            </telerik:RadComboBox>
            <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
 
                <script type="text/javascript">
                    function LocationCityIndexChanged(sender, args) {
                        var grid = $find("<%= ClassGrid.ClientID %>");
                        var tableView = grid.get_masterTableView();
                        tableView.filter("Location_DisplayCity", args.get_item().get_value(), "EqualTo");
                    }
                </script>
 
            </telerik:RadScriptBlock>
        </td>
    </tr>
    <tr>
        <th align="right">
            Time:
        </th>
        <td align="left">
            <telerik:RadComboBox ID="ddlClassTime" Width="100%" Skin="Web20" AllowCustomText="true"
                EmptyMessage="--Select A Time--" MarkFirstMatch="true" Filter="StartsWith" runat="server"
                Sort="Ascending" OnClientSelectedIndexChanged="ClassTimeIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem Text="All" />
                </Items>
            </telerik:RadComboBox>
            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
                <script type="text/javascript">
                    function ClassTimeIndexChanged(sender, args) {
                        var grid = $find("<%= ClassGrid.ClientID %>");
                        var tableView = grid.get_masterTableView();
                        tableView.filter("Class_Start_Time", args.get_item().get_value(), "EqualTo");
                    }
                </script>
 
            </telerik:RadScriptBlock>
        </td>
    </tr>
    <tr>
        <th align="right" style="white-space:nowrap;">
            Day of Week:
        </th>
        <td align="left">
            <telerik:RadComboBox ID="ddlDayOfWeek" Width="100%" Skin="Web20" AllowCustomText="true"
                EmptyMessage="--Select A Day--" MarkFirstMatch="true" Filter="StartsWith"
                runat="server" Sort="Ascending" OnClientSelectedIndexChanged="DayofWeekIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem Text="All" />
                    <telerik:RadComboBoxItem Text="Sunday" Value="SUN" />
                    <telerik:RadComboBoxItem Text="Monday" Value="MON" />
                    <telerik:RadComboBoxItem Text="Tuesday" Value="TUE" />
                    <telerik:RadComboBoxItem Text="Wednesday" Value="WED" />
                    <telerik:RadComboBoxItem Text="Thursday" Value="Thu" />
                    <telerik:RadComboBoxItem Text="Friday" Value="Fri" />
                    <telerik:RadComboBoxItem Text="Saturday" Value="Sat" />
                </Items>
            </telerik:RadComboBox>
            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
 
                <script type="text/javascript">
                    function DayofWeekIndexChanged(sender, args) {
                        var grid = $find("<%= ClassGrid.ClientID %>");
                        var tableView = grid.get_masterTableView();
                        tableView.filter("tmp", args.get_item().get_value(), "Contains");
                    }
                </script>
 
            </telerik:RadScriptBlock>
        </td>
    </tr>
</table>
<telerik:RadGrid ID="ClassGrid" runat="server" AllowMultiRowSelection="false" AutoGenerateColumns="False"
    OnNeedDataSource="ClassGrid_NeedDataSource" OnDataBound="ClassGrid_DataBound"
    Skin="WebBlue" GridLines="Both" ShowGroupPanel="false" ShowHeader="true" OnItemDataBound="ClassGrid_ItemDataBound"
    AllowPaging="true" PageSize="10" AllowFilteringByColumn="true">
    <ExportSettings FileName="AvailableClassListExport" ExportOnlyData="true" OpenInNewWindow="True"
        HideStructureColumns="true">
    </ExportSettings>
    <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" PagerStyle-AlwaysVisible="true">
        <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="false"
            ShowExportToCsvButton="false" ShowExportToWordButton="false" ShowExportToPdfButton="false" />
        <RowIndicatorColumn Visible="True">
        </RowIndicatorColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="Class_ID" Display="false" HeaderText="ID">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn UniqueName="Class_Date" DataField="Class_Date" Display="true"
                HeaderText="Date" AllowFiltering="true" PickerType="DatePicker" DataType="System.DateTime"
                DataFormatString="{0:ddd}">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn UniqueName="tmp" DataField="Class_Date" Display="false"
                HeaderText="Date" AllowFiltering="true" DataFormatString="{0:ddd, MMM dd, yyyy}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Class_Start_Time" Display="false" HeaderText="Start Time"
                AllowFiltering="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Class_End_Time" Display="false" HeaderText="End Time"
                AllowFiltering="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Location_Name" Display="false" HeaderText="Location">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Street_Address" Display="false" HeaderText="Address">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="City" Display="false" HeaderText="_City">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FK_State_Code" Display="false" HeaderText="State">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="Zip" Display="false" HeaderText="Zip">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="Class_Status" Display="false" HeaderText="Status">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="isSpanish" Display="false" HeaderText="Spanish"
                AllowFiltering="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Location_DisplayCity" Display="false" HeaderText="City"
                AllowFiltering="true">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Class">
                <ItemTemplate>
                    <div style="float:left;padding: 0px 15px 0px 0px;font-weight:bold;">
                        <%#Eval("Class_Date", "{0:ddd, MMM dd, yyyy}")%>
                        <br />
                        <%#Container.DataItem("Class_Start_Time")%>
                        -
                        <%# Container.DataItem("Class_End_Time") %>
                        <br /><br /><br /><br /><br />
                    </div>
                    <div>
                        <span><b>
                            <%# Container.DataItem("Location_Name") %></b>
                            <%#IIf(Container.DataItem("isSpanish") = "Y", " (Spanish)", " (English)")%>
                            <br />
                            <%# Container.DataItem("Street_Address") %>
                            <br />
                            <%# Container.DataItem("City") %>,
                            <%# Container.DataItem("FK_State_Code") %>
                            <%# Container.DataItem("Zip") %>
                            <br />
                            <b>Cross Streets:</b>
                            <%# container.DataItem("Cross_Streets") %>
                            <br />
                            <!-- Map -->
                            <%#"<a href=""http://www.mapquest.com/maps?city=" + Container.DataItem("City") + "&state=" + Container.DataItem("FK_State_Code") + "&address=" + Container.DataItem("Street_Address") + "&zipcode=" + Container.DataItem("Zip") + "&country=US&CID=lfmaplink"" target=""_Blank"">Map</a>"%>
                            <!-- Seperator -->
                            |
                            <!-- Directions -->
                            <%#"<a href=""http://www.mapquest.com/maps?2c=" + Container.DataItem("City") + "&2s=" + Container.DataItem("FK_State_Code") + "&2a=" + Container.DataItem("Street_Address") + "&2z=" + Container.DataItem("Zip") + "&2y=US&Form=directions&CID=lfddlink"" target=""_Blank"">Directions</a>"%>
                            <br />
                            <br />
                        </span>
                    </div>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
        <Selecting AllowRowSelect="True"></Selecting>
        <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
            ResizeGridOnColumnResize="False"></Resizing>
    </ClientSettings>
    <GroupingSettings ShowUnGroupButton="true" />
    <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
</telerik:RadGrid>
Martin
Telerik team
 answered on 08 Oct 2010
1 answer
161 views
Hi all,

I have radgrid with nested detail view, detail view uses object datasource.
The input method of obect data source (SelectMethod)  accepts object as input paraemeter on
OnSelecting event.

Now iam gettting Datakey value in ItemCommand event, when user hits the expand button, 
but not able to pass this kayvalue as input parameter in OnSelecting event of objectdatasource due to both events fire at different post.
How can i paas objects property (Datakey i.e EmpId) runtime to detailview of radgrid.

something like this...
input object as a parameter to object datasource
Class Employee
{
   EmpId=0;
   EmpName="";
   Age="";
   

}

<asp:ObjectDataSource ID="ObjectDataSource" runat="server" SelectMethod="GetEmpTicketDetails"
                                                TypeName="EmployeeRecordSOAP" OnSelecting="ObjectDataSource_Selecting"
                                                OnObjectCreating="ObjectDataSource_Creating">
                                                <SelectParameters>
                                                     
                                                   
                                                <asp:Parameter  Type="Object" Employee" DefaultValue="null"  />
                                                   
                                                </SelectParameters>

protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            EmpInputParams obj = new EmpInputParams();
            EmpID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmpId"].ToString();   
      
        }

protected void ObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
        
          EmpInputParams obj = new Diebold.SERAS.Controls.AdvisorWS.EmpInputParams();
          obj.EmpId=-1;
          obj.EmpName="";  
          e.InputParameters["obj"] = obj;        
     
        }




Vasil
Telerik team
 answered on 08 Oct 2010
1 answer
84 views
Hi,

Can someone tell me how can I get rid of numbers displayed on top of each bar on the chart attached as it is simply displaying the value from Y-Axis?

Many thanks.
MG
FISCAL
Top achievements
Rank 1
 answered on 08 Oct 2010
1 answer
341 views
Hello...

I have a Grid whose columns contains controls, for example, a RadMasketTextBox control. I implemented the TextChanged of that control to set the value of a hidden field to "true".

The problem is that I want to read that hidden field from a JavaScript. Is it possible to do it? I tried with RadAjaxManager, with this settings:

<rad:RadAjaxManager ID="ajaxManager" runat="server">
    <AjaxSettings>
        <rad:AjaxSetting AjaxControlID="gdvPeriodos">
            <UpdatedControls>
                <rad:AjaxUpdatedControl ControlID="gdvPeriodos" />
                <rad:AjaxUpdatedControl ControlID="hidModificado" />
            </UpdatedControls>
        </rad:AjaxSetting>
    </AjaxSettings>
</rad:RadAjaxManager>
<asp:HiddenField ID="hidModificado" Value="false" runat="server" />

When the JavaScript function executed the following command:
var serverModifiedFlag = eval(document.getElementById('hidModificado').value);
always "false" is returned, even when I modify the hidden value from a Grid event in codebehind.

Any help will be appreciated
Thanks

Jaime


Maria Ilieva
Telerik team
 answered on 08 Oct 2010
3 answers
118 views
After upgrading to the latest version I've noticed a very behaviour with the RadGrid. If I change the properties in the normal properties in Visual Studio for anything under EditFormSetting, it won't be trigger a change in the the actual code most of the times. Changing other properties though will work as expected (at least the ones I've tried). Well, guess what, when changing the same properties in the Teleriks "Properties builder" on the Smart tag (same page, same grid), it ALWAYS works as expected. Please note that in the properties window (ie not the properties builder), the displayed properties do change, but it just doesn't trigger any changes in the code.

Yes, I know this sounds weird, but I have witnesses that can confirm this is actually happening and not something I've dreamt up :)
improwise
Top achievements
Rank 1
Iron
Iron
 answered on 08 Oct 2010
1 answer
238 views
Hi,

I am using RadFilter with RadGrid. When I use the filter option I see that it is case sensitive. Is it possible for me to make the filter work ignoring the case.

Thanks,
Mithun 
Sebastian
Telerik team
 answered on 08 Oct 2010
1 answer
108 views
The following is my grid code. I could expland multiple details at once. I only wanted one detail to be opened at a time. For example, when i expand one, it should collaps other details. I tried for the property but was unable to find. Any help is appreciated.

<telerik:RadGrid ID="grdWorkFlow" runat="server" Width="100%" ShowStatusBar="True" AutoGenerateColumns="False"
                                            PageSize="7" AllowSorting="True" AllowPaging="True" GridLines="None">
                                            <PagerStyle Mode="NumericPages"></PagerStyle>
                                            <ClientSettings EnableRowHoverStyle="true">
                                                <Selecting AllowRowSelect="true" />
                                            </ClientSettings>
                                            <MasterTableView Width="100%" DataKeyNames="Record_Status_ID" AllowMultiColumnSorting="True"
                                                AllowFilteringByColumn="False" ExpandCollapseColumn-Display="True">
                                                <DetailTables>
                                                    <telerik:GridTableView DataKeyNames="ID" Name="Workflow_list" Width="100%" AllowPaging="True" PageSize="5" AlternatingItemStyle-BackColor="AliceBlue">
                                                        <Columns>
                                                          
                                                            <telerik:GridBoundColumn SortExpression="ID" HeaderText="EFDR#"
                                                                HeaderButtonType="TextButton" DataField="ID" Visible="true">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton"
                                                                DataField="Name" UniqueName="Name">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn SortExpression="Date" HeaderText="Date"
                                                                HeaderButtonType="TextButton" DataField="Date" UniqueName="Date">
                                                            </telerik:GridBoundColumn>
                                                           <telerik:GridTemplateColumn UniqueName="View">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lnkView" runat="server" CausesValidation="false" CommandArgument='<%# Eval("ID") %>'
                                                                        CommandName="View" Text="View"></asp:LinkButton>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="10px" />
                                                            </telerik:GridTemplateColumn>
                                                           
                                                           
                                                           
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                                <ExpandCollapseColumn Visible="True">
                                                </ExpandCollapseColumn>
                                                <Columns>
                                                    <telerik:GridBoundColumn SortExpression="Record_Status_ID" HeaderText="Record_Status_ID"
                                                        HeaderButtonType="TextButton" DataField="Record_Status_ID" Visible="False">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn SortExpression="Description" HeaderText="Work Flow Item"
                                                        HeaderButtonType="TextButton" DataField="Description">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn SortExpression="Num" HeaderText="Number" HeaderButtonType="TextButton"
                                                        DataField="Num">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 08 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?