I'm trying to find a DropDownList in my RadGrid using FindControl() method. But it's always returning null so it cannot find the DropDownList. I have the following HTML code:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
DataSourceID
=
"SqlDataSource1"
GroupPanelPosition
=
"Top"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"SqlDataSource1"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"myName"
HeaderText
=
"header text"
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"myDropDown"
DataTextField
=
"TextFieldValue"
DataValueField
=
"ValueFieldValue"
runat
=
"server"
/>
</
EditItemTemplate
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
And I'm trying to find "myDropDown" using this C# code:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
DropDownList list = (DropDownList)item.FindControl(
"myDropDown"
);
}
}
But it cannot find the DropDownList. Can you tell me what I'm doing wrong?
Any help appreciated.
Regards,
Danilo
See Telerik column chart demo here:
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/columnchart/defaultcs.aspx
Notice the labels above each column, such as "25000 sales". Now notice in the declarative code how this label is set:
<LabelsAppearance DataFormatString="{0} sales" Position="OutsideEnd"></LabelsAppearance>
I either need to set DataFormatString programmatically, or (better yet) I need to set it to the value of a column in my dataset from sql server. This column's data is not on the chart currently because I ONLY want that column's data used at the label at the top of each column. I can't figure out how to do either. How is it done?
Hi ,
I have a radgrid in radpane. The Radgrid loses its height and the data is not visible. Tried one of the links by telerik http://www.telerik.com/forums/radgrid-in-radpane-problem-with-100-height. This is not working. Thanks for the Help.
Is it possible with Telerik MVC Grids to customize the pager similar to how grouping works?
So for instance I want to look at all of Student A's records and I don't care about how many rows will be returned.
Then I want to use the pager to look at all of Student B's records.
Is such a thing even possible? :)
I get the error "These columns don't currently have unique values" when I have more than one NULL parent value in my list. The element Ids are all unique but I always get the error. Please help.
Sample data
parentId elementId elementText
NULL 116 ​Text1
116 2108 ​ Text2
2108 2109 Text3
2108 2110 Text4
NULL 72 Text5
72 655 Text6
72 660 Text7
72 672
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"ram"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnExportTasks"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"btnExportTasks"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Response.End()
End Sub
Hello All
I am using RadAsyncUpload and using a custom HTTPHandler and inserting the files directly to DB. Before inserting I am checking for the MIME Type of the file. I am getting the MIME type from Uploadedfile.ContentType. This is returning NULL for .zip file.I am using IE 10 and the version of Telerik is 2014.3.1024.35
Any help is much appreciated.
Thanks
Rakesh
Hi,
I try to Bind an RadAutoCompleteBox with a Dictionnary, but I have this error message when the page i​s loaded and I tap a letter into the RadAutoCompleteBox => "The control DataSource(or DataSourceID) is not set."
I try the following code :
ASCX :
<
telerik:RadAutoCompleteBox
runat
=
"server"
ID
=
"RadAutoCompleteBox1"
InputType
=
"Text"
Width
=
"200"
DropDownWidth
=
"150px"
></
telerik:RadAutoCompleteBox
>
ASCX.CS
01.
protected
void
Page_Load(
object
sender, EventArgs e)
02.
{
03.
if
(!Page.IsPostBack)
04.
{
05.
Dictionary<
int
,
string
> dict =
new
Dictionary<
int
,
string
>();
06.
dict.Add(1,
"Ann"
);
07.
dict.Add(2,
"John"
);
08.
dict.Add(3,
"Mary"
);
09.
RadAutoCompleteBox1.DataSource = dict;
10.
RadAutoCompleteBox1.DataTextField =
"Value"
;
11.
RadAutoCompleteBox1.DataValueField =
"Key"
;
12.
}
13.
}
Thanks for helping me