Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
126 views
I have a user control which has a combobox and two label.  The user control will be created inside of RadContextMenu.  I like to access label witnin this user control from Javacript.  Can you help me point out how I can do this?

User Control Definition

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Sample_CheckComboBox.ascx.cs" Inherits="StoneHorse3.Controls.Sample_CheckComboBox" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<br />
<table cellpadding="0" cellspacing="1"  width="88">
    <tr>    
        <td>
            <telerik:RadButton ID="btnFilter" runat="server" Text="Apply" Width="39px" Height="25px" OnClick="btnFilter_Click" >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton>                           
        </td>       
        <td>
            <telerik:RadButton ID="btnClear" runat="server" Text="Clear" Width="39px" Height="25px" onclick="btnFilterClear_Click"  >
                <Image ImageUrl="~/Images/bloombergyellowsmall.png" IsBackgroundImage="true" />
            </telerik:RadButton
        </td>
    </tr>
    <tr >
        <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
    </tr>       
    <tr>
        <th colspan="2">
            <telerik:RadComboBox ID="cmbFieldList" runat="server" AutoPostBack="true"
            OnItemDataBound="cmbFieldList_ItemDataBound" Style="z-index: 9000"
            OnClientDropDownClosing="radComboBox_OnClientDropDownClosing" OnClientDropDownOpening="radComboBox_OnClientDropDownOpening"
            >
            </telerik:RadComboBox>                   
            <asp:Label ID="lblFieldName" runat="server" Text="" ></asp:Label>
            <asp:Label ID="lblSectorID" runat="server" Text="" ></asp:Label>
        </th>                     
    </tr>
</table>
<br />

the label I like to gain access to are "lblFieldName" and "lblSectionID"

In Javascript I want to assign colUniqueName and sectorid to each of these two labels.

var filteredColId = "";
function showMenu(event, colUniqueName, filtertype, sectorid) {
            $find("<%=rcmCheckCombo.ClientID%>").show(event);
            ???lblFieldName= colUniqueName;
            ???lblSectorID= sectorid;
    }
}
How can I do something like this?  what would be the proper syntax? 

Thanks

Mark
Boyan Dimitrov
Telerik team
 answered on 12 Oct 2012
7 answers
242 views
Hi,

Is there any way to have a "Show all" option on the pager for the Grid?

Thanks,
Dewang
Rohan
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
133 views
I 'm facing with the problem of PageIndex change doesn't work in my grid.I try to research with another Radgrid view's page index is working well.Could u pls check below grid?

          <telerik:RadGrid ID="RadGrid2" runat="server"  
                            AllowPaging="true"
                          GridLines="Horizontal" AutoGenerateColumns="False" 
                            onitemcommand="Edit_Command">
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="True">
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                                    Visible="True">
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                    Visible="True">
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" 
                                        HeaderText="ID" SortExpression="ID" UniqueName="ID" Visible="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="DOID" 
                                        FilterControlAltText="Filter DOID column" HeaderText="Ref No" 
                                        SortExpression="DOID" UniqueName="DOID">
                                    </telerik:GridBoundColumn>
                                  <%--  <telerik:GridBoundColumn DataField="DeliveryDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"
                                        FilterControlAltText="Filter DeliveryDate column" HeaderText="DeliveryDate" 
                                        SortExpression="DeliveryDate" UniqueName="DeliveryDate">
                                    </telerik:GridBoundColumn>--%>
                                    <telerik:GridBoundColumn DataField="ExpectedDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}"
                                        FilterControlAltText="Filter ExpectedDate column" HeaderText="ExpectedDate" 
                                        SortExpression="ExpectedDate" UniqueName="ExpectedDate">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ConsignmentType" 
                                        FilterControlAltText="Filter ConsignmentType column" 
                                        HeaderText="ConsignmentType" SortExpression="ConsignmentType" 
                                        UniqueName="ConsignmentType">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Reason" 
                                        FilterControlAltText="Filter Reason column" HeaderText="Reason" 
                                        SortExpression="Reason" UniqueName="Reason">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Status" 
                                        FilterControlAltText="Filter Status column" HeaderText="Status" 
                                        SortExpression="Status" UniqueName="Status">
                                    </telerik:GridBoundColumn>
                                   <telerik:GridEditCommandColumn ButtonType="ImageButton"
                                UniqueName="EditCommandColumn">
                            </telerik:GridEditCommandColumn>
                                </Columns>
                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                        </telerik:RadGrid>

I do appreciate every suggestion.Thanks.
Andrey
Telerik team
 answered on 12 Oct 2012
1 answer
254 views
I am dynamically building a grid control on the PAGE_LOAD event. Column headers and data are all bound on the fly, nothing is static. I am using the the Filter Icons and have set AllowMultiColumnSorting = "TRUE".

I am able to sort only by one column. When I try to enter data into a second field to sort by a second field, my first sort value goes away. What is needed to keep these sort values?

Here is some code to help you understand how my grid is built.

All help is greatly appreciated!

Dim RadGrid1 As RadGrid = New RadGrid
 
RadGrid1.ID = "RadGrid1"
RadGrid1.Width = Unit.Percentage(100)
RadGrid1.PageSize = 5
RadGrid1.AllowPaging = True
RadGrid1.AllowSorting = True
RadGrid1.AllowFilteringByColumn = True
RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
RadGrid1.PagerStyle.Position = GridPagerPosition.TopAndBottom
RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom
RadGrid1.MasterTableView.CommandItemStyle.BackColor = Color.LightGray
RadGrid1.MasterTableView.CommandItemStyle.ForeColor = Color.Black
RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = False
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToPdfButton = True
RadGrid1.MasterTableView.CommandItemSettings.ShowExportToExcelButton = True
RadGrid1.MasterTableView.AllowFilteringByColumn = True
RadGrid1.ExportSettings.ExportOnlyData = True
RadGrid1.AutoGenerateColumns = False
RadGrid1.Skin = "MetroTouch"
RadGrid1.BorderStyle = BorderStyle.None
RadGrid1.MasterTableView.HeaderStyle.ForeColor = Color.White
RadGrid1.MasterTableView.EnableColumnsViewState = False
RadGrid1.MasterTableView.PageSize = 15
RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace
RadGrid1.MasterTableView.AllowMultiColumnSorting = True

Dim tblStopData As DataTable = New DataTable
 
            Dim cmd As SqlCommand = New SqlCommand("SP_STORED_PROC", conn)
 
            cmd.CommandType = CommandType.StoredProcedure
 
            Dim adapter As New SqlDataAdapter(cmd)
            adapter.SelectCommand.CommandTimeout = 300
 
            adapter.Fill(tblStopData)
 
            Dim name(tblStopData.Columns.Count) As String
            Dim i As Integer = 0
            For Each column As DataColumn In tblStopData.Columns
                Dim boundColumn As GridBoundColumn = New GridBoundColumn
                RadGrid1.MasterTableView.Columns.Add(boundColumn)
                boundColumn.DataField = column.ColumnName
                boundColumn.HeaderText = column.ColumnName
                'boundColumn.AndCurrentFilterFunction = GridKnownFunction.Contains
                boundColumn.ShowFilterIcon = True
            Next
 
            RadGrid1.DataSource = tblStopData
            RadGrid1.Rebind()
Eyup
Telerik team
 answered on 12 Oct 2012
2 answers
165 views
Hi,

My grid was exporting okay before I added a footer. Kostadin helped me get the dynamic footer working, but after clicking the export button, I get a null reference exception during PreRender where the data items are accessed in order to populate the footer.

I have set EnableViewState to false, set export settings in the button control, and added an update panel with a post back trigger on the button to no avail.

protected void Button1_Click(object sender, EventArgs e)
{
    RadGrid grid = (RadGrid)PlaceHolder1.FindControl("RadGrid1");
 
    grid.AllowSorting = false;
    grid.Columns.FindByUniqueName("EditCommandColumn").Visible = false;
    grid.ExportSettings.ExportOnlyData = true;
    grid.ExportSettings.IgnorePaging = true;
    grid.ExportSettings.OpenInNewWindow = true;
    grid.ExportSettings.FileName = "WastewaterExport";
 
    grid.MasterTableView.ExportToExcel();
}

Any ideas?

Thanks,
David
Kostadin
Telerik team
 answered on 12 Oct 2012
1 answer
122 views

I have a RadFilter with a custom FieldEditor control inside the <FieldEditors></FieldEditors> tags.

The custom field control is a class inherited from RadFilterDataFieldEditor.

In the InitializeEditor(System.Web.UI.Control container) method, a RadComboBox is instantiated and
added to the Controls collection of the container parameter.   The DataTextField property of the RadComboBox is text while the DataValueField property of the RadComboBox is a numeric value corresponding to the text's numeric ID.

When a filter expression is added, the dropdown listbox is displayed for selecting the filter value as the text.  However once the RadFilter Apply button is clicked on postback, the combobox changes to a textbox with the numeric value.

Can't figure out why this is happening.  Could use some help!  Thanks in advance.

 

Tsvetina
Telerik team
 answered on 12 Oct 2012
5 answers
547 views
2009.3.1210.35



DetailTables does not have ClientSettings.
In Master table I have these two defined to true but I want them false in the Detail Table.

Selecting-AllowRowSelect="false" EnableRowHoverStyle="false"

Please advise, thanks.
Eyup
Telerik team
 answered on 12 Oct 2012
1 answer
82 views
Hello

I've problem with my website when I use IE9. The rendering is different...

First config : IIS6.1 : OK
Second config : IIS6.0 (WS2003) : not OK

When I examine the CSS style (in IE9 developpement tools), I can see html class prefixed by "_Telerik_IE9" on 1st config, but not on the 2nd...

Is it normal ? Did I forget something ?

Best regards,
MI87
Top achievements
Rank 1
 answered on 12 Oct 2012
3 answers
111 views
I have followed numerous tutorials and example and I have several problems with my simple example below.

1. Paging controls don't show
2. The OnInsertCommand gets called and my code actually inserts a record using a class I have created for that purpose.
3. The grid populates with my IEnumerable<myclass> data returned.
4.The Insert Record row shows at the top after clicking on "Add New Record" link; but does not go away after the record inserts!
5. The grid does not refresh after inserting a new record.

What am I doing wrong?

 

<
telerik:RadAjaxManager ID="radAjaxManager" runat="server">
                   <AjaxSettings>
                       <telerik:AjaxSetting AjaxControlID="radAjaxManager">
                           <UpdatedControls>
                               <telerik:AjaxUpdatedControl ControlID="radGridAchievements" />
                           </UpdatedControls>
                       </telerik:AjaxSetting>
                   </AjaxSettings>
               </telerik:RadAjaxManager>
 
               <telerik:RadGrid ID="radGridAchievements" runat="server"
                   AutoGenerateColumns="false" DataSourceID="odsAchievements"
                   AllowAutomaticInserts="true"
                   PageSize="5" AllowPaging="true"
                   OnInsertCommand="radGridAchievements_InsertCommand" OnItemInserted="radGridAchievements_OnItemInserted">
                   <PagerStyle Mode="NextPrevAndNumeric" />
                   <MasterTableView DataKeyNames="Id" DataSourceID="odsAchievements"
                       EditMode="InPlace" CommandItemDisplay="TopAndBottom">
                       <Columns>
                           <telerik:GridEditCommandColumn ButtonType="LinkButton" />
                           <telerik:GridTemplateColumn DataField="Title" HeaderText="Title" >
                               <ItemTemplate>
                                   <%# Eval("Title") %>
                               </ItemTemplate>
                               <InsertItemTemplate>
                                   <telerik:RadTextBox ID="txtTitleInsert" runat="server" />
                               </InsertItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn DataField="Description" HeaderText="Description">
                               <ItemTemplate>
                                   <%# Eval("Description") %>
                               </ItemTemplate>
                               <InsertItemTemplate>
                                   <telerik:RadTextBox ID="txtDescriptionInsert" runat="server" />
                               </InsertItemTemplate>
                           </telerik:GridTemplateColumn>
                        </Columns>
                   </MasterTableView>
                   <ClientSettings AllowKeyboardNavigation="true">
                       <KeyboardNavigationSettings AllowSubmitOnEnter="true"/>
                       <ClientEvents
                                     OnGridCreated="OnAchievementGridCreated" />
                   </ClientSettings>
                   <ValidationSettings EnableValidation="true" CommandsToValidate="PerformInsert, Update" />
               </telerik:RadGrid>
 
               <asp:ObjectDataSource ID="odsAchievements" runat="server"
                   TypeName="GamesPlatform.External.Web.App.AchievementManager"
                   SelectMethod="GetAchievements"
                   OnObjectCreating="odsAchievements_ObjectCreating"
                   OnObjectDisposing="odsAchievements_ObjectDisposing" />
Eyup
Telerik team
 answered on 12 Oct 2012
3 answers
54 views
Hello! I ndeed someone to help me!
I have a GridbounColumn and a GridTemplateColumn like this:

  <telerik:GridBoundColumn DataField="PROCESVERBAL" DataFormatString="{0:N2}"   HeaderText="PROCESVERBAL"  
                                 UniqueName="PROCESVERBAL" FooterText=" " DataType="System.Text">
                                <FooterStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>  

  <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="center" HeaderStyle-Width="35px" HeaderText=""                 
                                UniqueName="viewCert2" Visible = "true">
                                <ItemTemplate>
                                <asp:ImageButton ID="viewCert2" runat="server" ImageUrl="~/Resources/IMG/viewformular.png"
                                ToolTip='<%# viewform %>'  />
                                </ItemTemplate>
                                </telerik:GridTemplateColumn>

I need to show the image button only if the value of "PROCESVERBAL" is different form null .
Is it possible??
Yllka
Top achievements
Rank 1
 answered on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?