This is a migrated thread and some comments may be shown as answers.

[Solved] Unknown server tag 'telerik:RadHtmlChart' (Problem in dll)

2 Answers 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 07 Apr 2013, 11:56 AM
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

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 08 Apr 2013, 04:52 AM
Hello,


If you do not want to show ID field in grid/page but you need this ID field in some events then please use DataKeyValue property of RadGrid.


<MasterTableView DataKeyNames="id" >

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.GetDataKeyValue("id"));
 
        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);
    }

Thanks,
Jayesh Goyani
0
Alex
Top achievements
Rank 1
answered on 08 Apr 2013, 06:06 AM
Hi Jayesh Goyani

Thanks, it works for me!

--Alex
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Alex
Top achievements
Rank 1
Share this question
or