Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
195 views

I have an existing app (written by a previous developer) that is calling a stored procedure that populates a RadGrid control. It populates fine the first time around.

However, when I change the date parameter, click "search" button, I get a blank RadGrid control. When I click search the second time, the grid is populated. When I walk through the code, I get an error message

Column 'ID' does not belong to table Table.

How can I resolve the issue of having to click search twice to display data ?


protected void btnSubmit_OnClick(object sender, EventArgs e)
{
    try
    {
        ViewState["newset"] = null;
        CreateDatasource();
        this.RadGrid1.DataBind();
        this.RadGrid1.CurrentPageIndex = 0;
        ViewState["newset"] = "new";   
         
        string idex = this.hdnindex.Value;
        if (idex != string.Empty)
            this.RadGrid1.MasterTableView.Items[int.Parse(idex)].Selected = true;
         
     }
     catch (Exception ex) {
        this.lblMessage.Text = ex.Message;
     }        
}
 
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    try
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink hLink = (HyperLink)item["ViewHyperLink"].Controls[0];
            if (hLink != null)
                hLink.Attributes.Add("onclick", "selectMe('" + item.ItemIndex + "');");
        }
    }
    catch (Exception ex)
    {
        this.lblMessage.Text = ex.Message;
    }
}

In the code behind above, when this.RadGrid1.DataBind() is called, the code steps into `RadGrid1_ItemCreated` loops through the if statement a few times, them goes into the if statement, comes out of the function, and then the catch statement of btnSubmit is called, which displays the error message "Column ID does not belong to table Table".   

Any ideas on how to resolve this?
AAA
Top achievements
Rank 1
 answered on 11 Apr 2013
3 answers
176 views
Hi,

How to get uploading file size on select event in client side?
I need to get uploading file size before a file will be uploaded.

Thank you in advance.
Kate
Telerik team
 answered on 11 Apr 2013
0 answers
130 views
Here's the working code:

In the page.aspx.cs, I define a static variable:

private static TextBox txtName;

 

In the Page_Load() event, I initialize it:

txtName = (TextBox)RadPanelBar1.FindItemByValue("Add").Controls[0].FindControl("TxtName");


The questions is:
1- I had to make the textbox "static" to make the code work, why?
2- The initialization code didn't work when I put it in the if (!IsPostBack) block, I had to make it run  in every page load. why? and is there a better approach to achieve the same functionality?

 

 

 

 

Mohamed
Top achievements
Rank 1
 asked on 11 Apr 2013
5 answers
238 views
Hi all -

I am having an issue with the RadNumericTextBox that hopefully someone knows the solution to.  If I have the Input set to numeric and I copy-paste "$12.53" (or any other currency value), the result is that the value in the input ends up as "0.12" (or 0.[first two digits]).  It seems like, instead, the input box should be ignoring all characters other than acceptable numeric values.  This can be duplicated in the online example.  Anyone have any idea how to resolve this?

Thanks,
Ryan
Vasil
Telerik team
 answered on 11 Apr 2013
4 answers
569 views
Hi,

In the code below I keep getting an error on this line when the code executes: RadPanelBar rpb = (RadPanelBar)pv.Controls[0];
The error is an unable to cast object error.

Any idea how to resolve this? 

protected void RadButtonExpandAll_Click(object sender, EventArgs e)
        {
            int selectedIndex = RadTabStrip1.SelectedIndex;
            if (selectedIndex >= 0)
            {
                RadPageView pv = RadMultiPage1.PageViews[selectedIndex];
                RadPanelBar rpb = (RadPanelBar)pv.Controls[0]; // This is what errors //


                foreach (RadPanelItem r in rpb.Items)
                {
                    r.Expanded = true;

                }

            }
        }

Thanks,

Kevin


Kevin
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
79 views
Hello,

We just upgraded our old ASP.NET AJAX components. It turns out that columns with visible = false does not get populated (for better performance). However we have a lot of hidden columns, like ID columns, that we use for in-line editing etc.

Is there anyway to populate these columns? Or do we have to change them all to visible and hide them in the PreRender event? (Which makes the markup very confusing, as you have to go to code behind to see which columns are actually visible on the page)
Oxygen
Top achievements
Rank 1
 answered on 11 Apr 2013
0 answers
66 views

Has anyone come up with a good solution? I’ve tried so many different ways and still having the problem. I was able to just hard code it on one of my pages because there was only 5 items. One of my other pages has 55 items and I need a fix to this. I have other web pages that will be impacted as well. Any solutions that worked for other folks would be appreciated. Here is one link I’ve tried:

http://stackoverflow.com/questions/5584500/ordered-list-showing-all-zeros-in-ie9

Other situation I tried:

I just tried the code below and have the following error: Microsoft JScript runtime error:

Unable to set value of the property 'innerHTML': object is null or undefined

<!DOCTYPE html> <HTML> <HEAD> <TITLE>IE9 Ordered List Zero Bug</TITLE> </HEAD> <BODY> <DIV id="dv1"> <OL> <LI>AAA</LI> <LI>BBB</LI> </OL> </DIV> <DIV id="dv2"></DIV> <SCRIPT type="text/javascript"> document.getElementById("dv1").innerHTML = "<ol><li>XXX</li><li>YYY</li></ol>"; var container = document.createElement('span'); container.style.display = "none"; document.getElementById("dv2").appendChild(container); </SCRIPT> </BODY> </HTML>

Link: http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/7b278286-4d47-4556-aa57-cbaf68edeef8

ttaylor29
Top achievements
Rank 1
 asked on 11 Apr 2013
1 answer
104 views

Hello,

 I have a Problem after the last Telerik ASP.NET update.

 I have a Grid with Columns they are the visible properties is false. I need some column values for the Event.

 Here is my Grid:

<telerik:RadGrid ID="RadGridStaticContainer" runat="server" CellSpacing="0"
    Culture="de-DE" DataSourceID="ODSStaticContainers" GridLines="None"
    onitemcommand="RadGridStaticContainer_ItemCommand"
    onitemdatabound="RadGridStaticContainer_ItemDataBound">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="StaticID"
        DataSourceID="ODSStaticContainers">
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
            Visible="True">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
            Visible="True">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
         
        <Columns>
                <telerik:GridBoundColumn DataField="StaticID" DataType="System.Int64"
                    FilterControlAltText="Filter StaticID column" HeaderText="StaticID"
                    ReadOnly="True" SortExpression="StaticID" UniqueName="StaticID" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PlayerLayoutID" DataType="System.Int64"
                    FilterControlAltText="Filter PlayerLayoutID column" HeaderText="PlayerLayoutID"
                    SortExpression="PlayerLayoutID" UniqueName="PlayerLayoutID" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerID" DataType="System.Int64"
                    FilterControlAltText="Filter ContainerID column" HeaderText="ContainerID"
                    SortExpression="ContainerID" UniqueName="ContainerID" Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerName" DataType="System.String"
                    FilterControlAltText="Filter ContainerName column" HeaderText="ContainerName"
                    SortExpression="ContainerName" UniqueName="ContainerName">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn DataField="ContainerObjects"
                    FilterControlAltText="Filter ContainerObjects column"
                    HeaderText="ContainerObjects" SortExpression="ContainerObjects"
                    UniqueName="ContainerObjects">
                    <ItemTemplate>
                        <asp:Label ID="ContainerObjectsLabel" runat="server"
                            Text='<%# Eval("ContainerObjects") %>' EnableTheming="True"></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="SchedulerID" DataType="System.Int64"
                    FilterControlAltText="Filter SchedulerID column" HeaderText="SchedulerID"
                    SortExpression="SchedulerID" UniqueName="SchedulerID" Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerType"
                    FilterControlAltText="Filter ContainerType column" HeaderText="ContainerType"
                    SortExpression="ContainerType" UniqueName="ContainerType">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerColor"
                    FilterControlAltText="Filter ContainerColor column" UniqueName="ContainerColor"
                    Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerTop" DataType="System.Int32"
                    FilterControlAltText="Filter ContainerTop column" UniqueName="ContainerTop"
                    Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerLeft" DataType="System.Int32"
                    FilterControlAltText="Filter ContainerLeft column" UniqueName="ContainerLeft"
                    Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerWidth" DataType="System.Int32"
                    FilterControlAltText="Filter ContainerWidth column" UniqueName="ContainerWidth"
                    Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContainerHeight" DataType="System.Int32"
                    FilterControlAltText="Filter ContainerHeight column"
                    UniqueName="ContainerHeight" Visible="False">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="editContainerObjects"
                    FilterControlAltText="Filter editObjects column" HeaderText="<%$ Resources:InsertObjects, Edit %>"
                    ImageUrl="~/cms/images/symbols/Edit.png" UniqueName="editContainerObjects">
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn DataField="ContainerObjects"
                    FilterControlAltText="Filter ContainerObjectsHidden column"
                    UniqueName="ContainerObjectsHidden" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="ContainerObjectsHiddenLabel" runat="server"
                            Text='<%# Eval("ContainerObjects") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
 
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>

Here is my Event:

protected void RadGridStaticContainer_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == "editContainerObjects")
    {
        GridDataItem item = (GridDataItem)e.Item;
 
        staticObjectsID = Convert.ToInt64(item.GetDataKeyValue("StaticID").ToString());
        string objectType = item["ContainerType"].Text.Trim();
 
        Label lbl = item.FindControl("ContainerObjectsHiddenLabel") as Label;
        string containerObjects = lbl.Text.Trim();
 
        containerHeight = Convert.ToInt32(item["ContainerHeight"].Text.Trim());
        containerWidth = Convert.ToInt32(item["ContainerWidth"].Text.Trim());
 
        HiddenStaticWidth.Value = containerWidth.ToString();
        HiddenStaticHeight.Value = containerHeight.ToString();
 
        LoadObjectEditor(objectType, containerObjects,false);
    }
}

I don't get the values for containerheight and the other values.

What can i do that this works fine again?

Reiner








Princy
Top achievements
Rank 2
 answered on 11 Apr 2013
2 answers
222 views
I am creating rad windows from an external XML datasource. But I cannot affect the positioning or size. Below is my ASPX
<div id="dashboardContainer">
            <div id="dbTitle">
                <span>DSX Web Data Center</span>
                <div id="dbMenu">
                    <ul id="dbMenuItems">
                                <li>Open Workspace</li>
                                <li>Create Workspace</li>
                                <li>Most Recent Workspace</li>
                            </ul>
                </div>
            </div>
            <div id="dbPanelContainer" runat="server">
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
            </div>
            <div id="dbDSXLogo"></div>
        </div>

Below is my C#
private void LoadDBPanels()
    {
         
        //Get Panel Information
        string xmlFile = "http://localhost/test/dbPanelsXML.xml";
        XmlTextReader reader = new XmlTextReader(xmlFile);
        //  Loop over the XML file
        while (reader.Read())
        {   
            //  Here we check the type of the node, in this case we are looking for element   
            if (reader.NodeType == XmlNodeType.Element)   
            {       
                //  If the element is "profile"       
                if (reader.Name == "panel")       
                {
 
                    //Create panel
                    RadWindow panel = new RadWindow();
                    panel.OffsetElementID="dbPanelContainer";
                    panel.VisibleOnPageLoad = true;
                    panel.Width = new System.Web.UI.WebControls.Unit(reader.GetAttribute("PanelWidth"));
                    panel.Height = new System.Web.UI.WebControls.Unit(reader.GetAttribute("PanelHeight"));
                    panel.Title = reader.GetAttribute("PanelTitle");
                    panel.ID = reader.GetAttribute("PanelID");
                    panel.Top = new System.Web.UI.WebControls.Unit(reader.GetAttribute("PanelTop"));
                    panel.Left = new System.Web.UI.WebControls.Unit(reader.GetAttribute("PanelLeft"));
                    panel.VisibleStatusbar = false;
                    panel.RestrictionZoneID = "dbPanelContainer";
                    panel.NavigateUrl = "http://www.deslongchamps.me";
                    RadWindowManager1.Windows.Add(panel);      
                }   
            }
        }//end while
 
         
    }

Below is my XML Sample
<?xml version="1.0" encoding="utf-8" ?>
<panels>
  <panel>
    <PanelID>DBPanel1</PanelID>
    <PanelTitle>Panel 1</PanelTitle>
    <PanelWidth>0</PanelWidth>
    <PanelHeight>0</PanelHeight>
    <PanelTop>0px</PanelTop>
    <PanelLeft>0px</PanelLeft>
    <PanelData>1</PanelData>
    <PanelType>1</PanelType>
  </panel>
  <panel>
    <PanelID>DBPanel2</PanelID>
    <PanelTitle>Panel 1</PanelTitle>
    <PanelWidth>400</PanelWidth>
    <PanelHeight>1700</PanelHeight>
    <PanelTop>0</PanelTop>
    <PanelLeft>410</PanelLeft>
    <PanelData>1</PanelData>
    <PanelType>1</PanelType>
  </panel>
</panels>

Also, when you click on the window or drag the window, the elements drop down and to the left.

Any help would be great!
Michael
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
204 views
Hi,

We are currently using version 2012.2.724.40 of RadControls for ASP.NET AJAX, Windows7, and IE8.
For our intranet web application, I've set up a screen to use a RadListBox to display a list of text items for ease of set up and display, so I can automatically get the needed scroll bars and limit the height and width before scroll bars appear etc.  I am not using any of the 'Transfer' functionality and the user cannot select anything from the list.... it's just a display-only list (for now). 

While the RadListBox works perfectly for my display, my user wants to be able to copy from the resulting display to put the text list on their clipboard.  Is there anyway to do this, like with skins or CSS or anything, to make the rendered text available to a copy/paste action?

Or is there another control that I could use to accomplish this without losing the scrolling/visual display capabilities?

Thanks for any help!
Shawna
Nencho
Telerik team
 answered on 11 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?