Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
282 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
197 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
136 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
589 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
94 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
124 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
59 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
1 answer
135 views
Hello,

I want to capture when a node was clicked (in fact right clicked) in an OrgChart. I want the event to pass the ID of the node clicked.

Can anyone please suggest how to do it.

Thanks
Peter Filipov
Telerik team
 answered on 12 Oct 2012
2 answers
143 views
Hello,

I have to display multiple text items in a node in an Telerik OrgChart control.

So I am using RenderedFields like this:
</RenderedFields>
 <ItemFields>
 <telerik:OrgChartRenderedField DataField="Certificates" Label="Certificates" />
 </ItemFields>
<ItemFields>
 <telerik:OrgChartRenderedField DataField="Role" Label="Role" />
 </ItemFields>

 </RenderedFields>


However I want to style each OrgChartRenderedField differently. Infact some of these fields will be hidden in some situations.

Can anyone suggest how to do it.

Thanks
Peter Filipov
Telerik team
 answered on 12 Oct 2012
1 answer
93 views
Hi, I'm using a rad window inside a usercontrol to display the content which was referred by an another usercontrol on a button Click,
The rad window is displaying the data in Chrome, Safari, Firefox, IE7 & IE8 . In IE9 when i click on the Button Its giving an error for the first time 
"DOM Exception: INVALID_CHARACTER_ERR (5)" & from second click onwards its just opening the rad window but its not displaying the content. 

This is the line where i'm getting the error.
var o=($telerik.isIE)?document.createElement("<iframe name='"+c+"'>"):document.createElement("iframe");

I have approached the following threads:
http://www.telerik.com/community/forums/aspnet/window/radwindow-ie9.aspx

Please find the error message in image file "IMG_12102012_134211.png" in the attachment.

Please suggest a work around to solve this problem.




Marin Bratanov
Telerik team
 answered on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?