<
asp:DropDownList
ID
=
"ddlDataSource"
runat
=
"server"
></
asp:DropDownList
>
<
asp:LinkButton
ID
=
"lnkBtnA"
runat
=
"server"
Text
=
"Button A"
OnClick
=
"LnkBtnA_OnClick"
></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"lnkBtnB"
runat
=
"server"
Text
=
"Button B"
OnClick
=
"LnkBtnB_OnClick"
></
asp:LinkButton
>
<
telerik:RadGrid
ID
=
"radGrid1"
runat
=
"server"
>
<
ExportSettings
OpenInNewWindow
=
"true"
ExportOnlyData
=
"true"
IgnorePaging
=
"true"
>
</
ExportSettings
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
ScrollHeight
=
"200px"
/>
</
ClientSettings
>
<
MasterTableView
Width
=
"100%"
HorizontalAlign
=
"NotSet"
AutoGenerateColumns
=
"False"
NoMasterRecordsText
=
"No Items available"
>
<
Columns
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
LnkBtnA_OnClick(
object
sender, EventArgs e)
{
try
{
this
.radGrid1.Visible =
true
;
this
.radGrid1.MasterTableView.Columns.Clear();
switch
(
this
.ddlDataSource.SelectedValue)
{
case
"DataSource1"
:
this
.AddColumnsToGrid();
this
.radGrid1.DataSource = MyDataSource1;
this
.radGrid1.DataBind();
break
;
case
"DataSource2"
:
this
.AddColumnsToGrid();
this
.radGrid1.DataSource = MyDataSource2;
this
.radGrid1.DataBind();
break
;
default
:
break
;
}
}
catch
(Exception ex)
{
throw
;
}
}
private
void
AddColumnsToGrid()
{
this
.radGrid1.MasterTableView.Columns.Clear();
switch
(
this
.ddlDataSource.SelectedValue)
{
case
"DataSource1"
:
GridBoundColumn subjectColumnR1 =
new
GridBoundColumn();
subjectColumnR1.DataField =
"Subject"
;
subjectColumnR1.HeaderText =
"Subject"
;
this
.radGrid1.MasterTableView.Columns.Add(subjectColumnR1);
GridBoundColumn dueDateColumnR1 =
new
GridBoundColumn();
dueDateColumnR1.DataField =
"DueDateTime"
;
dueDateColumnR1.HeaderText =
"DueDateTime"
;
this
.radGrid1.MasterTableView.Columns.Add(dueDateColumnR1);
GridBoundColumn ownerColumnR1 =
new
GridBoundColumn();
ownerColumnR1.DataField =
"Owner"
;
ownerColumnR1.HeaderText =
"Owner"
;
this
.radGrid1.MasterTableView.Columns.Add(ownerColumnR1);
break
;
case
"DataSource2"
:
GridBoundColumn subjectColumnR2 =
new
GridBoundColumn();
subjectColumnR2.DataField =
"Subject"
;
subjectColumnR2.HeaderText =
"Subject"
;
this
.radGrid1.MasterTableView.Columns.Add(subjectColumnR2);
GridBoundColumn dueDateColumnR2 =
new
GridBoundColumn();
dueDateColumnR2.DataField =
"DueDateTime"
;
dueDateColumnR2.HeaderText =
"DueDateTime"
;
this
.radGrid1.MasterTableView.Columns.Add(dueDateColumnR2);
GridBoundColumn ownerColumnR2 =
new
GridBoundColumn();
ownerColumnR2.DataField =
"Manager"
;
ownerColumnR2.HeaderText =
"Manager"
;
this
.radGrid1.MasterTableView.Columns.Add(ownerColumnR2);
break
;
default
:
break
;
}
}
protected
void
LnkBtnB_OnClick(
object
sender, EventArgs e)
{
try
{
this
.AddColumnsToGrid();
// <-- Even though I do this. The columns go missing.
// Does something not related to the question
}
catch
(Exception ex)
{
throw
;
}
}
I've looked through the help and just can't seem to figure out how to do this. In my dropdownlist, I want to create sub menu items for a couple of the items in the list.
Currently the dropdownlist items are being added in the code behind. Like this:
ddlSystem.Items.Add(
new
DropDownListItem(LogFile.CHCS, LogFile.CHCS));
ddlSystem.Items.Add(
new
DropDownListItem(LogFile.DCIPS, LogFile.DCIPS));
ddlSystem.Items.Add(
new
DropDownListItem(LogFile.EPEB, LogFile.EPEB));
So what I'm trying to do is change CHCS so that there are sub items under it that will fly out when you hover over it.
Thanks for any thoughts.
Rodney
Hi,
Wondering how we can add reorder animation when user is reordering the items in the radlistbox ?
A example would be the list in invisionapp.com as attached.
If cannot be done, I will submit a feature request.
Thanks.
Hi
I have a RadMenu that is populated from an xml file, the definition of the item is
<Item Text="Menu" Url="" >
<Item Text="Item 1" Url="~/test.aspx" Value="itemValue" />
</item>
and then on the clientClicking event I have
function onClicking(sender, eventArgs) {
var item = eventArgs.get_item();
var navigateUrl = item.get_navigateUrl();
var text = item.get_text();
var value = item.get_value();
alert("Text : " + text + " Value : " + value );
}
I get the text attribute but I always get null for the value attribute. I have been searching but found nothing on how to bind the radmenu to an xml using the value property.
THanks
Hi all,
I am currently building an application for one of our clients using some of the Telerik UI for ASP.NET AJAX controls. The deployment process is outlined in the Telerik online documentation (http://docs.telerik.com/devtools/aspnet-ajax/deployment/deploying-a-telerik-enabled-webapplication). So one thing is to include the required Telerik DLLs in the delivered solution.
In order to deliver a web application to a client that is making use of the Telerik UI for ASP-NET AJAX controls, is it sufficient to just deliver the web abblication including the Telerik DLLs or is it also necessary to prevent the client from being able to access the Telerik DLLs for his own purpose as this section in the Documentation suggests? http://docs.telerik.com/devtools/aspnet-ajax/deployment/protecting-the-telerik-asp.net-ajax-assembly
According to this post, every DevCraft license holder should now be able to download the source code for the Telerik.Web.UI dll so it can be included in the project and be hidded in the built project dll. http://www.telerik.com/forums/telerik-source-code#6GEkR8E0p0aXwdcdiokl6
Unfortunately I am not able to download the required source code as it is not visible in the downloadable files under Products & Subscriptions --> DevCraft Complete --> Download --> UI for ASP.NET AJAX --> Browse all product files
Kind regards,
Thomas
Hi!
Is it possible to have pop-up or edit form show up when adding new records to the grid or when "edit" button is clicked, but still have some cells "editable" in a batch edit mode fashion?
I was thinking of switching edit mode from code behind, when "Add" or "Edit" buttons are clicked, but when "batch" mode is enabled, there's no callback. Any ideas?
Thanks!
Andy