Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
304 views
Hello, 
I have a dropdown, 2 link buttons(Lets say A and B) and a radgrid on my mark up page. The dropdown will select my DataSource for the grid. LinkButton A will get the data source and and adds the columns to the grid programmatically and binds them all. The other(LinkButton B) will get the datafrom the grid and do something different(not related to the page), anyway it will create a postback. The columns will be different depending on the selected value of the dropdown as is the data source. I am able to bind the data and columns on the grid programmatically. But when I click on LinkButton B, The columns go missing but the data is still there. As the header texts are missing. (Check the images attached). Here is my code:

ASP Page
<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>

C# Code : 
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 saw this post as well. The RadGrid is created on Page_Init and then added. But I want to keep the mark up and only bind the data and columns through server side. I tried using Rebind() and DataBind() function on 'LnkBtnB_OnClick', Then all the data disappears. I do not want to Bind the data on every post back.

If theres a way to make the columns not to disappear then its great. I am also okay if theres a fix to bind only the columns as well. But not to bind all the data.

Thank you
Fernando
Top achievements
Rank 2
 answered on 16 Mar 2016
3 answers
274 views

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

 

 

 

Ivan Danchev
Telerik team
 answered on 16 Mar 2016
3 answers
282 views
I've been using some of your competitors' diagramming products over the years and was pretty excited to see this addition to the Telerik toolset.

That said, there are several features that prohibit my move to the Telerik diagram control. Is there a feature roadmap to help me see if/when these might appear?

Note: its possible these are implemented somehow and I just missed how to do it - if so, please advise!

#1: Click and double click events on a shape.
#2: Events associated with creating connections between shapes (I need an event that fires when the "drag" operation starts and one that fires when the user finishes by selecting the target shape).
#3: Fix the bug that prohibits the EndCap feature from working.
#4: Allow shapes to be dragged and dropped between 2 diagram controls (and fire the associated drag-drop events on the target diagram container).
#5: Click/double click event on connections.
#6: Shapes currently support text inside the shape - how about text as a label above (or below) the shape. I want to have shapes in the form of small circles that have a text label above showing the user what the shape represents.

Whew - these are the top ones I can think of right off. I'm sure there are more - but if your new control could support the above, I get to drop the other vendor solutions and go 100% Telerik.

Thanks!
Dave
Vessy
Telerik team
 answered on 16 Mar 2016
3 answers
229 views
Hi,

i'm trying to do the following.....

I want to validate a username is unique from a RadTextBox and handle TextChanged which calls the database.  What I subsequently need to do is get the client to display a radalert or a radwindow to display saying the name is already in use.

I have a RadAjaxManager, and enabled the textbox within it.

In textchanged handler I try to inject a radalert

RadAjaxManager1.ResponseScripts.Add("radalert('UserName is already in use!')");

but it never displays.

Is this something that is possible, or not?

Regards
Paul.



Bijoy Mohanta
Top achievements
Rank 1
 answered on 16 Mar 2016
27 answers
1.1K+ views
I just update my project from radControls for ASP.NET Ajax Q2 2012 to Q3 2012 and now I am getting the following error:

Telerik.Web.UI.RadFormDecorator with ID='RadFormDecorator1' was unable to find an embedded skin with the name 'WebBlue'. Please, make sure that the skin name is spelled correctly and that you have added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If you want to use a custom skin, set EnableEmbeddedSkins=false.


I checked and I DO have a reference to Telerik.Web.UI.Skins.dll in my project! I even tried deleting and re-adding the reference with no luck. I checked the version of the Telerik.Web.UI.Skins.dll Telerik.Web.UI.Skins.dll file in my /Bin folder and it is the correct version. I've restarted Visual Studio repeatedly and it doesn't help!
Maria Ilieva
Telerik team
 answered on 16 Mar 2016
3 answers
169 views
Is there any way to get the number of nodes an object of type RadDropDwonTree contains?
Nencho
Telerik team
 answered on 16 Mar 2016
2 answers
113 views

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.

 

HSLaw
Top achievements
Rank 1
 answered on 16 Mar 2016
0 answers
132 views

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

 

 

 

 

 

 

Alejandro
Top achievements
Rank 1
 asked on 15 Mar 2016
3 answers
536 views

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

 
Pavlina
Telerik team
 answered on 15 Mar 2016
5 answers
317 views

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

Andy
Top achievements
Rank 1
 answered on 15 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?