Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
100 views
Hi all,

Long time lurker first time poster.

I'm developing a report using the RadGrid control (full version) and one of the requirements is that it must be possible to filter the rows. Previously before using the RadGrid I'd obviously just filter the data source then re-render the html table but.... you know RadGrids are pretty and support so much functionality out of the box I thought what the hell?

Anyway - obviously I'm posting because its not gone too swell.

Initially I got the Expression Expected error... all fine and good, tons of threads with the answer set EnableLinqExpressions="False". Did that and sure enough the error disappeared.... however no filtering appeared? As in after the postback was finished no filtering had been applied. I was kind of under the impression from the Basic Filtering Tutorial that it should be a pretty much out of the box "hey presto no need to manually make all the filters" deal? Starting to think that's not the case.

Anyway - details: -

I'm using the OnNeedDataSource event, the code currently looks -roughly- like: -

protected void MyGrid_OnNeedData(object sender, GridNeedDataSourceEventArgs e)
    {
 
        ...General getting data stuff...
 
        MyGrid.DataSource = MyData;
    }

With MyData being a List<MyObject>.

Now there WAS something about using the OnNeedDataSource event in the basic filtering tutorial. I didn't think it was 100% clear though to be honest as it talked about "checking" the FilterExpression in the OnNeedDataSource event - is this actually implying that if you use this method of data binding you do have to manually do all the filtering? As you might have guessed I'm rather hoping thats NOT the case heh.

Anyway - appreciate any input. Thanks!
Craig
Top achievements
Rank 1
 answered on 08 Apr 2013
1 answer
390 views
I've been trying to debug this error that's been popping up in the event viewer and I can't figure out what's causing it. There are some oddities happening on the site, but I'm not sure (and somewhat doubt) this is the reason, but I'm just going through the process of elimination now.

Anyway, this is what I get: An error occurred processing a web or script resource request. The requested resource 'pTelerik.Web.UI.Skins|Telerik.Web.UI.Skins.Common.Metro.contextMenu.gif' does not exist or there was a problem loading it. 

Can anyone point me in the right direction and help me troubleshoot this? The version of RadControls that I'm using is 2013.1.220.45.

Thank you,
Andrew
Ivan Zhekov
Telerik team
 answered on 08 Apr 2013
1 answer
142 views
Hi,

I would like to know how to center the text inside the radpanel. i have added an image but as a result the text is off center.

i have attached an image of my problem,
Princy
Top achievements
Rank 2
 answered on 08 Apr 2013
0 answers
125 views
Hello to all

How to enable false radwindow contentemplate by using javascript or jquery.

this RadWindow1.Enabled = True
by client side
Jack
Top achievements
Rank 1
 asked on 08 Apr 2013
4 answers
1.3K+ views
I have a RadTimePicker that I would like to use 24 hour format on. I have the format in 24 hours, but when I click 13:00 it puts 1:00 p.m. in the box. How can I get it to put the 24 hour format in the box?

<telerik:RadTimePicker ID="ddlTravelStart"
    runat="server"
    TimeView-TimeFormat="HH:mm" >
</telerik:RadTimePicker>
K10
Top achievements
Rank 1
 answered on 08 Apr 2013
1 answer
86 views
As the below which is RadGrid method in client how to get user control in client, but recently I use treelist, i can not use same method for it. Please tell me how to find the checkbox element in javascript! thankss!!!

var grid = $find("<%= grdDetail.ClientID %>");
              var masterTable = grid.get_masterTableView();
              var rows = masterTable.get_dataItems();
                var i;
                for (i = 0; i < rows.length; i++) {
                    var rowResult = rows[i];
                        var textBoa= rowResult.findControl("textBoa");
                        var textBoc= rowResult.findControl("textBoc");
                        var Checkbox= rowResult.findElement("Checkbox");
                     }
Angel Petrov
Telerik team
 answered on 08 Apr 2013
2 answers
184 views
Hi Telerik Team,

When i add RadHtmlChart, I am faced the error
Unknown server tag 'telerik:RadHtmlChart'

then by following this link
http://www.telerik.com/community/forums/aspnet-ajax/htmlchart/unknown-server-tag-telerik-radhtmlchart.aspx
i updated the controls to newer version. then the RadHtmlChart works fine.

But now the problem is,
after updation, the itemCommand in the RadGrid are showing error.
here is my code.
protected void rgFiles_ItemCommand(object source, GridCommandEventArgs e)
   {
       int index = int.Parse(e.Item.ItemIndex.ToString());
       GridDataItem item = (GridDataItem)FileTable.MasterTableView.Items[index];
       item.Selected = true;
 
       row_id = int.Parse(item["id"].Text);
 
       string File_name = item["Name"].Text;
       Label2.Text = File_name;
       LiteralControl litCon = new LiteralControl();
       litCon.Text = "<iframe name='attachIFrame' id='runtimeIFrame'  frameborder='solid' word-wrap='normal' scrolling='auto' height='100%' width='400px'  src='RiskManagementStrategyFiles/" + File_name + "' style='left:0; background-color: beige;'></iframe>";
       Panel1.Controls.Add(litCon);
   }
visible property for id is "false" in .aspx page

Error
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 219:        item.Selected = true;
Line 221:        row_id = int.Parse(item["id"].Text);
Line 223:        string File_name = item["Name"].Text;

this error is solved, if we give visible property = "true" in .aspx page
SortExpression="id" UniqueName="id" Visible="true" HeaderStyle-CssClass="hide" ItemStyle-CssClass="hide">
------------------------
//CSS
.hide { display:none; }


but if i do like this, I have many RADgrids in my project. I need to change in all the grids.

(Again if i repalce the dll in Bin folder with the old dll, then the grid works fine but RadHtmlChart showing the same error)
Please help me....

Please give solution for this


Thanks in advance
--Alex

Alex
Top achievements
Rank 1
 answered on 08 Apr 2013
5 answers
926 views
Hello,

I have this radgrid that i want to perform edit funtion. Going into edit mode wasn't a problem.
But i can see the UPDATE and CANCEL buttons. here is my radgrid and i use datatable to populate it.
any suggestion?

 <telerik:RadGrid ID="RadGrid1" runat="server" ShowFooter="true" AutoGenerateColumns="False"
                    AllowSorting="true" EnableEmbeddedSkins="True" Skin="Sunset" Width="1000px"
                    EnableLinqExpressions="false" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource1"
                    OnItemCreated="RadGrid1_ItemCreated">
                    <MasterTableView DataKeyNames="Account" EditMode="InPlace">
                        <Columns>
                            <telerik:GridButtonColumn Text="Edit" CommandName="Edit" ButtonType="PushButton">
                                <ItemStyle HorizontalAlign="Center" CssClass="BorderLeft BorderRight BorderBottom" />
                                <FooterStyle CssClass="BorderLeft BorderRight BorderBottom" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn DataField="LongAccount" HeaderStyle-HorizontalAlign="Center"
                                UniqueName="LongAccount" HeaderText="Account" ReadOnly="true" ShowSortIcon="false"
                                FooterText="Sub Total">
                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left" Width="100px" CssClass="BorderRight BorderBottom" />
                                <FooterStyle CssClass="BorderRight BorderBottom" />
                            </telerik:GridBoundColumn>
                         
                        </Columns>
                        <EditFormSettings>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableEmbeddedSkins="False">
                    </FilterMenu>
                </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 08 Apr 2013
1 answer
215 views
I want to change font-family of Titlebar of radwindow in javascript .
Princy
Top achievements
Rank 2
 answered on 08 Apr 2013
1 answer
178 views
I'm trying to figure out how to dynamically add columns to a hierarchical/nested grid in a RadGrid.  Which columns need to be created are determined by a Check Box List control.  And I only know for sure which columns to add after the RadGrid_DetailTableDataBind is called.

I can get it all to work if I set AutoGenerateColumns to TRUE.  But of course I need to make two of the columns (if they are selected) TemplateColumns.  Which is why I have to dynamically add the columns.

To me it looks like I have two choices (neither of which I could make work).   1) Add the columns to a statically created hierarchical grid.  Or 2) Create the hierarchical grid dynamically and then the columns.  

For the first option after the RadGrid_DetailTableDataBind is invoked, a datatable is populated from a database query. After the datatable (which is going to be the datasource) is generated I call the following routine (with datasource table as the one calling parameter).

Sub AddColumnsToGrid(ByVal ResultTable As DataTable)
    Dim bc As GridBoundColumn
     
    Dim dgOSEvent As GridTableView = RadGrid1.MasterTableView.DetailTables(0)
    dgOSEvent.Columns.Clear()
    'Dim dgOSEvent As GridTableView = New GridTableView(RadGrid1)
     
    bc = New GridBoundColumn()
    bc.DataField = "% of Total"
    bc.HeaderText = "% of Total"
    bc.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    bc.DataFormatString = "{0:p}"
    dgOSEvent.Columns.Add(bc)
 
    bc = New GridBoundColumn()
    bc.DataField = "Count"
    bc.HeaderText = "Event Count"
    bc.ItemStyle.HorizontalAlign = HorizontalAlign.Center
    bc.DataFormatString = "{0:###,###,###}"
    dgOSEvent.Columns.Add(bc)
     
    For Each dc As DataColumn In ResultTable.Columns
        If dc.ColumnName <> "COUNT" And dc.ColumnName <> "% of Total" Then
            If dc.ColumnName = "SOURCE" Or dc.ColumnName = "DESTINATION" Then
                Dim tc As GridTemplateColumn = New GridTemplateColumn()
                tc.HeaderTemplate = New DataGridTemplate(ListItemType.Header, dc.ColumnName)
                tc.ItemTemplate = New DataGridTemplate(ListItemType.Item, dc.ColumnName)
                tc.ItemStyle.HorizontalAlign = HorizontalAlign.Center
                dgOSEvent.Columns.Add(tc)
            Else
                bc = New GridBoundColumn()
                bc.DataField = dc.ColumnName
                bc.HeaderText = dc.ColumnName
                If dc.ColumnName = "Description" Then
                    bc.ItemStyle.HorizontalAlign = HorizontalAlign.Left
                Else
                    bc.ItemStyle.HorizontalAlign = HorizontalAlign.Center
                End If
                dgOSEvent.Columns.Add(bc)
            End If
        End If
         
    Next
End Sub

I can post the code for DataGridTemplate, but I don't think that's the problem here.  I suspect that I'm getting something more fundamental wrong. 

The results I get when running this code is I do get a grid row for each record in my results.  Their headers are blank and the contents of the GridBoundColumn are: System.Data.DataRowView.  The template columns are blank.

My attempt at the 2nd approach was even less successful.  So I'll need more direction if this turns out to be the best way to go.

Thanks for any help on this.


Shinu
Top achievements
Rank 2
 answered on 08 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?