Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
239 views
Is there a way to make the filter work with text entered for a RadGrid GridDropDownList and respect the lookup values (ie a databound lookup) for ListTextField instead of the numeric ID?

Also, similar question:  When a GridDropDownList column is grouped in RadGrid, the ID is displayed in the group header instead of the databound ListTextField value.  So it shows xxx: 1830 instead of xxx: Bob Smith  ?
Mira
Telerik team
 answered on 26 Apr 2011
3 answers
108 views
I have a grid with three columns and I want user to enter their filter values and then click "Search Filter" button which is outside the grid.
Two columns have a textboxes for filter and the last column has a combobox with checkbox in it.
Everything works fine when the textbox columns are filtered. Problem occurs when the combobox with checkbox is selected.  it returns no data found. You  can see the image attached and also Client and Serverside codes.

Do let me know where am I going wrong...Any help will be appreciated.

Thanks

ASPX
<telerik:RadGrid ID="rgPartnerPhone" runat="server" AllowFilteringByColumn="True"
   AllowPaging="True" AllowSorting="True" DataSourceID="dsPartnerPhone" GridLines="None"
Skin="Outlook" Width="100%" ShowGroupPanel="True" AutoGenerateColumns="False"
 PageSize="50" Height="570px" OnItemCreated="rgPartnerPhone_ItemCreated" OnPreRender="rgPartnerPhone_PreRender"
 ShowFooter="true">
 <MasterTableView DataSourceID="dsPartnerPhone" DataKeyNames="ProductID,  ProductName"
PageSize="50" Width="100%" GroupLoadMode="Client" EnableNoRecordsTemplate="true"
ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="true" AllowMultiColumnSorting="true"
EnableHeaderContextMenu="true">
<NoRecordsTemplate>
<div style="color: Red; font-weight: bold">
No data found.</div>
</NoRecordsTemplate>
<Columns>
 <telerik:GridNumericColumn DataField="ProductID" DataType="System.Int32" HeaderText="ProductID"
 SortExpression="ProductID" UniqueName="ProductID" ShowFilterIcon="false" AutoPostBackOnFilter="false"
CurrentFilterFunction="EqualTo" NumericType="Number" MaxLength="10" FilterControlWidth="60px"
HeaderStyle-Width="80px" ReadOnly="true" Groupable="false" AllowFiltering="true">
</telerik:GridNumericColumn>
<telerik:GridTemplateColumn DataField="ProductName" HeaderText="ProductName" AutoPostBackOnFilter="false"
FilterDelay="4000" ShowFilterIcon="false" SortExpression="ProductName" UniqueName="ProductName"
CurrentFilterFunction="Contains" ItemStyle-Wrap="false" FilterControlWidth="260px"
HeaderStyle-Width="280px" Groupable="false" AllowFiltering="true">
<ItemTemplate>
<asp:HyperLink ID="hlPName" runat="server" NavigateUrl='<%# Eval("CatalogPageLink")%>'
      Target="_blank" Text='<%# Eval("ProductName")%>' ToolTip="Get Catalog Details"></asp:HyperLink>
</ItemTemplate>
       </telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="EquipmentType" HeaderText="EquipmentType" SortExpression="EquipmentType"
UniqueName="EquipmentType" ShowFilterIcon="false" FilterControlWidth="140px"
HeaderStyle-Width="160px" ItemStyle-Wrap="false" AllowFiltering="true">
                      <FilterTemplate>
                         <telerik:RadComboBox ID="rcbEquip" runat="server" DataSourceID="dsGetEquipment"
AllowCustomText="true" DataTextField="EquipmentType" DataValueField="EquipmentTypeID"
Width="135px" AppendDataBoundItems="true" EmptyMessage="-- All Equipment --"
      HighlightTemplatedItems="true" AutoPostBack="true" TabIndex="1" Skin="Outlook"
OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownClosing="OnClientDropDownClosing"
OnClientSelectedIndexChanging="OnClientSelectedIndexChanging" OnClientBlur="OnClientBlur"
OnClientDropDownClosed="onDropDownClosing">
<ItemTemplate>
<div onclick="stopPropagation(event);">
<asp:CheckBox runat="server" ID="cbEquipment" 
Text='<%# DataBinder.Eval(Container, "Text") %>' />
</div>
</ItemTemplate>
</telerik:RadComboBox>
<asp:SqlDataSource ID="dsEquipment" runat="server" ConnectionString="<%$ ConnectionStrings:connGait %>"
  SelectCommand="dbo.CTsp_PPT_GetEquipmentType" SelectCommandType="StoredProcedure" />
  </FilterTemplate>
</telerik:GridBoundColumn>
  </Columns>
</MasterTableView>
<ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True"
EnableRowHoverStyle="true" EnablePostBackOnRowClick="false" AllowKeyboardNavigation="true"
ColumnsReorderMethod="Reorder">
<Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="0">
</Scrolling>
<ClientMessages />
</ClientSettings>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>


Server Side Code

protected void btnFilters_Click(object sender, EventArgs e)
   {
       GridFilteringItem item = rgPartnerPhone.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
       //for ComboBox
       string strEquip = string.Empty;
       RadComboBox comborcbEquip = (RadComboBox)item.FindControl("rcbEquip");
       foreach (RadComboBoxItem ritem in comborcbEquip.Items)
       {
           CheckBox checkBox = (CheckBox)ritem.FindControl("cbEquipment");
           if (checkBox.Checked)
           {
               strEquip += ritem.Text + ",";
           }
       }
       if (!string.IsNullOrEmpty(strEquip))
           strEquip = strEquip.Remove(strEquip.Length - 1);
        
       string strProductID = (item["ProductID"].Controls[0] as RadNumericTextBox).Text;
       string strProductName = (item["ProductName"].Controls[0] as TextBox).Text;
       string strEquipType = strEquip;
       string expression = "";
     
       if (strProductID != "")
       {
           if (expression != "")
               expression += " AND ";
           expression += "([ProductID]  = \'" + strProductID + "\')";  
       }
       if (strProductName != "")
       {
           if (expression != "")
               expression += " AND ";
           expression += "([ProductName] LIKE \'%" + strProductName + "%\')";
       }
       if (strEquipType != "")
       {
           string[] words = strEquipType.Split(',');
           foreach (string citem in words)
           {
               if (expression != "")
                   expression += " AND ";
               expression += "([EquipmentType] LIKE \'%" + citem + "%\')";
           }
       }
       rgPartnerPhone.MasterTableView.GetColumnSafe("ProductID").CurrentFilterValue = strProductID;
       rgPartnerPhone.MasterTableView.GetColumnSafe("ProductName").CurrentFilterValue = strProductName;
      rgPartnerPhone.MasterTableView.GetColumnSafe("EquipmentType").CurrentFilterValue = strEquipType;
       rgPartnerPhone.MasterTableView.FilterExpression = expression;
       rgPartnerPhone.MasterTableView.Rebind();
   }
Mira
Telerik team
 answered on 26 Apr 2011
4 answers
183 views
Hi,

I have a OnClientSelectedIndexChanged event on my combo box which is working fine in IE but not in Firefox. I'm using telerik version 2010.2.929.35.

Regards,
Lubna.
Dimitar Terziev
Telerik team
 answered on 26 Apr 2011
1 answer
51 views

hi

i want to use detail of uploaded file from RadAsyncUpload (like file size, content type and ...) before that i save it!

how can i do this?

Shinu
Top achievements
Rank 2
 answered on 26 Apr 2011
3 answers
117 views

Hi,

I'm trying to accomplish this: I need to hide my "Add own content" buttons when user enters Insert mode. To handle this, I subscribed ItemCommand event and check if CommandName is "InitInsert". If is, I set EventSource element visibility to false. That works great.

What's giving me hard time is EmptyDataTemplate. I placed my "Add own content" button in this template, but then after clicking it, layout changes, so of course setting visibility of this button to false have no meaning. I figured out, that I could handle LayoutCreated event and then find this button and hide it. There I encountered another problem: how to find out, whether I'm in Insert mode or not? InsertItem property of ListView is null, when I know that I entered insert mode. I looked through other properties and cannot seem to find out how to verify mode in which ListView is.

My question are:

1. How can I find out whether I'm in insert mode or not?

2. Is there any other way I can hide "add own content' button when in insert mode?

Thanks in advance,

Pako

Iana Tsolova
Telerik team
 answered on 26 Apr 2011
3 answers
48 views
Hi.
I have a problem when switching into Month View, after choosing New Appointment, i cannot see the lower part of the form.
Also, cannot get the mouse to focus on every day of the Scheduler, all this issues happen in Month View, any other view is perfectly fine.
I'll send a png to show better the 1st problem.
Veronica
Telerik team
 answered on 26 Apr 2011
2 answers
79 views
Hi,
I am facing an issue in the rendering of telerik editor in IE 9. The editor's image-pop-up and item-template-insert-pop-up don't render properly.
I am using version 2010.1.415.35 of telerik. Please advice me on this.

Thanks,
Abhinandan Bansal

Abhinandan Bansal
Top achievements
Rank 1
 answered on 26 Apr 2011
1 answer
89 views
Hi Team
i want to Use / symbol as By Default in Rad Date Picker
I want to Enter only Date Month Year / Should Come Automatically How i'll implement this.

Please give Me Solution as soon as possible.

Regards,
Ashok Anbarasu.
Shinu
Top achievements
Rank 2
 answered on 26 Apr 2011
2 answers
205 views
Hello All,

I have an application that utilizes a RadMultiPage, with both RadButtons and a RadTabStrip used to navigate between RadPageViews. I am currently experiencing an issue with a RadGrid on the third RadPageView (Index 2). I have specified the NeedDataSource event for the RadGrid, however, when I navigate to the RadPageView containing this RadGrid, the event is not fired. The peculiar thing is that the NeedDataSource event fires only once I click a RadButton, or RadTab, to move to any of the other pageviews.

Does anybody have any ideas as to why the event would not fire when that RadPageView is initially selected and instead is firing when I try to navigate away from that RadPageView??

I don't set the DataSource of the RadGrid anywhere else in the code behind; I only set it in the NeedDataSource event. When putting a breakpoint on the NeedDataSource event, the breakpoint is only hit when I click on any tab, or button, that takes me away from "rpvDetails".

Please let me know if you need me to list more code.

Thanks!
Casey

.ASPX page:
<div style="width: 60%; margin-top: 10px; float: left" align="center">
    <div>
        <telerik:RadTabStrip runat="server" ID="rtsLeaveRequestNav" SelectedIndex="0" OnTabClick="rtsLeaveRequestNav_TabClick">
            <Tabs>
                <telerik:RadTab Text="Start & End Dates" TabIndex="0" PostBack="true" Selected="true"
                    Width="150px" PageViewID="rpv1">
                </telerik:RadTab>
                <telerik:RadTab Text="FMLA Info" TabIndex="1" PostBack="true" Width="150px" PageViewID="rpv2">
                </telerik:RadTab>
                <telerik:RadTab Text="Details" TabIndex="2" PostBack="true" Width="150px" PageViewID="rpvDetails">
                </telerik:RadTab>
                <telerik:RadTab Text="Review & Save" TabIndex="3" PostBack="true" Width="150px" PageViewID="rpvReview">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
    </div>
</div>
<br />
<div style="width: 90%; margin-top: 5px; clear: both">
    <div style="float: left; width: 70%; margin-top: 5px; clear: both">
        <telerik:RadMultiPage ID="rmpLeaveRequest" runat="server" SelectedIndex="0" RenderSelectedPageOnly="true">
            <telerik:RadPageView ID="rpv1" runat="server" TabIndex="0">
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpv2" runat="server" TabIndex="1">
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpvDetails" runat="server" TabIndex="2">
                <div style="width: 95%; margin-top: 5px; clear: both; background-color: #E0E0E0;
                    margin-bottom: 50px" align="center">
                    <br />
                    <table style="border-style: outset; width: 80%; background-color: #E0E0E0; padding-bottom: 10px">
                        <tr>
                            <td style="margin-right: 10px" colspan="2" align="center">
                                <telerik:RadGrid ID="rgLeaveDetails" runat="server" AutoGenerateColumns="false" Width="100%"
                                    ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Scrolling-UseStaticHeaders="true"
                                    ClientSettings-Scrolling-ScrollHeight="90px" OnNeedDataSource="rgLeaveDetails_NeedDataSource">
                                    <MasterTableView TableLayout="Fixed" runat="server" ShowHeadersWhenNoRecords="true"
                                        EnableNoRecordsTemplate="false">
                                        <Columns>
                                            <telerik:GridBoundColumn UniqueName="ACTIVITY_DATE" DataField="ACTIVITY_DATE" HeaderText="Date">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="WORK_CODE" DataField="WORK_CODE" HeaderText="Leave Type">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="HOURS" DataField="HOURS" HeaderText="Duration">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                            <td align="center">
                                <table>
                                    <tr>
                                        <td>
                                            <telerik:RadButton ID="rbChooseType" runat="server" Text="Choose Leave Type" Width="115px" ButtonType="StandardButton">
                                            </telerik:RadButton>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadButton ID="rbEdit" runat="server" Text="Edit" Width="115px" ButtonType="StandardButton">
                                            </telerik:RadButton>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadButton ID="rbDelete" runat="server" Text="Delete" Width="115px" ButtonType="StandardButton">
                                            </telerik:RadButton>
                                            <br />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadButton ID="rbDeleteAll" runat="server" Text="Delete All" Width="115px" ButtonType="StandardButton">
                                            </telerik:RadButton>
                                            <br />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table style="border-style: outset; width: 80%; background-color: #E0E0E0; padding-bottom: 10px">
                        <tr>
                            <td colspan="3" align="left">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                            </td>
                            <td align="left">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                            </td>
                            <td align="left">
                            </td>
                        </tr>
                    </table>
                    <br />
                    <br />
                    <br />
                </div>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpvReview" runat="server" TabIndex="3">
            </telerik:RadPageView>
        </telerik:RadMultiPage>


Code Behind Events:
protected void rtsLeaveRequestNav_TabClick(object sender, RadTabStripEventArgs e)
{
    rmpLeaveRequest.SelectedIndex = rtsLeaveRequestNav.SelectedIndex;
}
 
protected void rgLeaveDetails_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    rgLeaveDetails.DataSource = String.Empty;
}
Iana Tsolova
Telerik team
 answered on 26 Apr 2011
1 answer
140 views
I would like to use a GridCalculatedColumn in conjunction with GridTemplateColumns.  However, all of the samples on the Telerik Demo site utilize GridBoundColumns in conjunction with GridCalculatedColumns.  I do not believe that I will be able to use a GridBoundColumn since I am binding to a collection of objects like so:

List<SelectedCourse> lstSelectedCourses = this.SelectedCourses;
 
            //Bind the GridView schedule
            gvSchedule.DataSource = lstSelectedCourses;
            gvSchedule.DataBind();

When I display the columns in the GridView, I use the following syntax:

<columns>
                        <telerik:gridtemplatecolumn>
                            <itemtemplate>
                                <asp:hiddenfield id="hfCourseID" value='<%#Eval("CourseID") %>' runat="server" />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Category">
                            <itemtemplate>
                                <asp:label id="lblCategory" runat="server" text='<%#Eval("Category") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Subject">
                            <itemtemplate>
                                <asp:label id="lblSubject" runat="server" text='<%#Eval("Subject") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Days">
                            <itemtemplate>
                                <asp:label id="lblDays" runat="server" text='<%#Eval("Days") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Start Time">
                            <itemtemplate>
                                <asp:label id="lblStartTime" runat="server" text='<%#Eval("StartTime") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="End Time">
                            <itemtemplate>
                                <asp:label id="lblEndTime" runat="server" text='<%#Eval("EndTime") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Term">
                            <itemtemplate>
                                <asp:label id="lblTerm" runat="server" text='<%#Eval("Term") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Length (Weeks)">
                            <itemtemplate>
                                <asp:label id="lblCourseLength" runat="server" text='<%#Eval("CourseLength") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Location">
                            <itemtemplate>
                                <asp:label id="lblLocation" runat="server" text='<%#Eval("Location") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>
                        <telerik:gridtemplatecolumn headertext="Cost">
                            <itemtemplate>
                                <asp:label id="lblCourseCost" runat="server" text='<%#Eval("Cost", "{0:C}") %>' />
                            </itemtemplate>
                        </telerik:gridtemplatecolumn>                       
                    </columns>

Is there a way to utilize the GridCalculatedColumn to sum up the value in the GridTemplateColumn for Cost?

Thanks. 
Iana Tsolova
Telerik team
 answered on 26 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?