Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
211 views
Hey,

I am not able to Populate dropdownlist with sql data source--aspx is

<telerik:GridDropDownColumn HeaderText="Items" UniqueName="column1" DataSourceID="SqlDataSource1"
                     ListTextField="ProductName" ListValueField="Pid" DataField="ProductName" >
                    </telerik:GridDropDownColumn>
Ans datasource is--
<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataReader"
            ConnectionString="<%$ ConnectionStrings:ChalkHillConnectionString3 %>"
            SelectCommand="SELECT [ProductName] FROM [tblProducts] ORDER BY [Pid]"></asp:SqlDataSource>
I am trying to populate ddl from ProductName column of my tblProducts.
Does'nt seem to be workin'.I am getting this error--

'System.Data.Common.DataRecordInternal' does not contain a property with the name 'Pid'

Plz help..
Thanks
Amit
Pavlina
Telerik team
 answered on 13 Oct 2010
3 answers
297 views
Hey,

I am new with telerik controls,and can't understand procedure required for binding a RadGrid.I've made a grid,this is .aspx file--

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
    GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound">
    <MasterTableView>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="Items" UniqueName="ItemColumn">
                <ItemTemplate>
                    <asp:Label ID="lblItemName" runat="server" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlItems" runat="server" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="ddlItems_SelectedIndexChanged" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Rate" UniqueName="RateColumn">
                <ItemTemplate>
                <asp:Label ID="lblRate" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Quantity" UniqueName="QuantityColumn">
                <ItemTemplate>
                    <asp:Label ID="lblQuantity" runat="server" />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadTextBox ID="txtQuantity" runat="server" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Amount" UniqueName="AmountColumn">
                <ItemTemplate>
                    <asp:Label ID="lblAmount" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn HeaderText="Done" Text="Done" UniqueName="Donecolumn">
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

I want the grid to be in edited mode initially on the page load,such that it contains a row in which 1st column has dropdownlist from which person selects the item and next column contains a label which will get the rate of the selected item in ddl on selectedIndex Changed of ddl.I tried it with Item bound event like--.cs file
protected void ddlItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlItems.SelectedIndex > 0)
            {
                DataSet ds = objSQLHelper.GetProductDetails("select * from tblProducts where Pid=" + ddlItems.SelectedValue);
                if (ds != null)
                {
                    lblRate.Text = ds.Tables[0].Rows[0]["Rate"].ToString();
                }
            }
        }
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {
                GridEditFormItem editform = (GridEditFormItem)e.Item;
                DropDownList ddlItems = (DropDownList)editform.FindControl("ddlItems");
                ddlItems.DataSource = ds;
                ddlItems.DataTextField = "ProductName";
                ddlItems.DataValueField = "Pid";
                ddlItems.DataBind();
            }
        }
 but that did'nt worked.I just want to show an empty edited RadGrid Initially At page load,where person places order by selecting values fom ddl and placing quantity in textbox.It not showing Grid in the browser.What to do?..And What's required thet i'm missing.Need some help...

Thanks
Amit.
Radoslav
Telerik team
 answered on 13 Oct 2010
3 answers
200 views
Hi, I've some troubles using the GridMaskedColumn from code behind with version 2010.1.309.35.

Here is how I add dynamically my column:
GridMaskedColumn maskColumn = new GridMaskedColumn();  
columns.Add(maskColumn);  
 
maskColumn.UniqueName = myDataField;  
maskColumn.HeaderText = myHeaderText;  
 
maskColumn.Mask = myMask;  
maskColumn.DataField = myDataField;  
maskColumn.SortExpression = myDataField;  
maskColumn.ShowSortIcon = true;  
maskColumn.ShowFilterIcon = true;  
maskColumn.ReadOnly = !editable; 

I'm using a "aaaa" mask to make sure it's the easiest as possible on a varchar(50) field which has valid values.  I have the same problem when table is empty.

It works great when displayed.  The filters are working correctly with defined mask(while testing something else than 'aaaa') but as soon as I click the edit button, I get an : Cannot create column with the specified type name: GridMaskedColumn

Here is the stack of the error. 
[GridException: Cannot create column with the specified type name: GridMaskedColumn]  
   Telerik.Web.UI.GridColumnCollection.CreateColumnFromTypeName(String columnTypeName) +1211  
   Telerik.Web.UI.GridColumnCollection.System.Web.UI.IStateManager.LoadViewState(Object savedState) +428  
   Telerik.Web.UI.GridTableView.LoadStructureState(Object SavedStructure) +354  
   Telerik.Web.UI.RadGrid.LoadTableViewStructure(IEnumerator stateEnumerator, GridTableView tableView) +101  
   Telerik.Web.UI.RadGrid.LoadViewState(Object savedStateObject) +276  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +183  
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221  
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221  
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134  
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221  
   System.Web.UI.Page.LoadAllState() +312  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661  
 
 

I checked and I'm not doing anything special with the column, even not providing mask gives the same error.

Thanks for your help solving this issue.
Mira
Telerik team
 answered on 13 Oct 2010
1 answer
91 views
Hello,

I am unable to download trainer tutorial and getting 403 error

I am using credentials of rrcholan.k@chintainfo.com

Please advice.

Thank you

Regards
Raj
Mira
Telerik team
 answered on 13 Oct 2010
2 answers
377 views
Hi all,
I was just using fiddler2 to investigate what is going over the wire when I detected a 500 error code. The error message indicates that the file ImageHandler.ashx is located in the special directory 'App_Themes' which would be forbidden.

So I checked that directory but couldn't find that file there. The only thing I could detect was a css-file with an entry like:

.RadForm_formdecorator_calculator.rfdTextarea textarea:hover {
    color: rgb(178, 28, 27);
    background-color: transparent;
    background-image: url('ImageHandler.ashx?mode=get&suite=aspnet-ajax&control=FormDecorator&skin=formdecorator_calculator&file=verlauf.png&t=769399777');

}

It seems that the url is causing the trouble. So I guess this stems from the usage of the stylebuilder. Has anybody experienced the same problem and even better - knows how to solve this issue ?

Thanks a lot,
Wolfgang
Wolfgang Sigel
Top achievements
Rank 1
 answered on 13 Oct 2010
4 answers
201 views
I am currently looking to use the export to pdf of the RadEditor however rather than allowing the user to save this directly, I am capturing the PDF byte array in the OnExport method to allow me to add custom headers and footers. I need to be able to cancel the writing of the PDF to the response by the radeditor itself but cannot find a way to prevent this. Can anyone point me in the right direction? If there is not a specific parameter to cancel the writing to the response object, is there any part of the page lifecyle I can hook into to clear the response?
David
Top achievements
Rank 1
 answered on 13 Oct 2010
1 answer
64 views
Im using Load on Demand on RadTreeView
Im loading Sub-nodes on node click, sub-nodes are loading but (+) is not converting into (-) at Parent node.

How to change (+) to (-) after expansion
Nikolay Tsenkov
Telerik team
 answered on 13 Oct 2010
1 answer
83 views
What do I need to do to implement a silverlight control into an Asp.Net application?  We currently own the ASP.NET ajax controls only.  Do we need to purchase the Silverlight package as well?   Will users accessing our website need to have Silverlight installed to view our charts if we use a Silverlight control?
Ves
Telerik team
 answered on 13 Oct 2010
1 answer
176 views
Dears,
I have a RadGrid with EditMode="EditForms", Inside the FormTemplate I have a readonly textbox, when user want to eneter a text he clicks a button near the textbox to open a rad window, user enter the text in the rad window and click ok. I manged to get the returned text from the radwindow argument but I could not find any way to set the text in the FormTemplate Textbox.
So' I was not able to reach the controls in the FormTemplate.
Could you please help me?
Princy
Top achievements
Rank 2
 answered on 13 Oct 2010
2 answers
72 views
I want to be able to enter my own controls within the Tree View instead of simply entering text in the tree view.  It would look something like the RadFilter in the end, except with different columns. It would have embedded RadComboBox and RadText controls in it.

Is there any way to do this within the telerik controls?
Nikolay Tsenkov
Telerik team
 answered on 13 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?