Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
50 views
I have a column in my grid that needs to change from either a dropdownbox or textbox based on the previous columns dropdown value.
Is this possible?

If you have any suggestions would be helpful.
Princy
Top achievements
Rank 2
 answered on 08 Dec 2010
1 answer
395 views
I have a radgrid with a readonly column named Status.  After my validation completes I need to change the value of the column if there is an error.  I'm having problems changing the value. Any suggestions would be helpful.

if (errorCount > 0)
{               
    TableCell statusCell = item["STATUS"];
    (statusCell.Controls[0] as TextBox).Text = "Error";
    (statusCell.Controls[0] as TextBox).BackColor = System.Drawing.Color.Red;
}
<telerik:RadGrid ID="rdDeposits" AllowSorting="False" AllowPaging="False" runat="server"
                            AutoGenerateColumns="False" AllowAutomaticInserts="False" OnPreRender="rdDeposits_PreRender" 
                            AllowAutomaticDeletes="False" Skin="Web20" OnNeedDataSource="rdDeposits_NeedDataSource"
                             OnItemDataBound="rdDeposits_ItemDataBound" GridLines="Horizontal"  OnItemCommand="rdDeposits_ItemCommand" 
                             OnItemCreated="rdDeposits_ItemCreated" OnDeleteCommand="rdDeposits_ItemDeleted"
                            AllowMultiRowEdit="False" Width="738px" Height="360px">
                            <MasterTableView ShowFooter="true" DataKeyNames="ESCROW_ACCOUNT_DEPOSIT_ID" CommandItemDisplay="Top" EditMode="InPlace" TableLayout="Fixed">
                                <CommandItemTemplate>
                                    <div style="padding: 5px 5px;">
                                        <asp:Button ID="btnAdd" CommandName="InitInsert" Text="Add Transaction" runat="server" />
                                    </div>
                                </CommandItemTemplate>
                                <Columns> 
                                    <telerik:GridBoundColumn DataField="ESCROW_ACCOUNT_DEPOSIT_ID" UniqueName="ESCROW_ACCOUNT_DEPOSIT_ID"
                                        ReadOnly="true" Visible="false">
                                    </telerik:GridBoundColumn>                                                                                               
                                    <telerik:GridDropDownColumn DataField="DEPOSIT_TRANS_TYPE_ID" HeaderText="Type" UniqueName="DEPOSIT_TRANS_TYPE_SDESC" 
                                        ListTextField="DEPOSIT_TRANS_TYPE_SDESC" ListValueField ="DEPOSIT_TRANS_TYPE_ID"
                                        DropDownControlType="DropDownList"  ColumnEditorID="GridDropDownColumnEditor1">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="110px" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> 
                                    </telerik:GridDropDownColumn>                                                      
                                    <telerik:GridBoundColumn DataField="EXPECTED_DATE" HeaderText="Expected Date" UniqueName="EXPECTED_DATE"
                                        ReadOnly="true">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EXPECTED_AMOUNT" HeaderText="Expected Amount"
                                        UniqueName="EXPECTED_AMOUNT" ReadOnly="true">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="100px" />
                                        <ItemStyle HorizontalAlign="Right"/>
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" /> 
                                    </telerik:GridBoundColumn>
                                    <telerik:GridDateTimeColumn DataField="ACTUAL_DATE" HeaderText="Actual Date" UniqueName="ACTUAL_DATE"
                                        DataType="System.DateTime" ColumnEditorID="GridDateTimeColumnEditor">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="100px" />                                        
                                    </telerik:GridDateTimeColumn>
                                    <telerik:GridNumericColumn DataField="ACTUAL_AMOUNT" HeaderText="Actual Amount" UniqueName="ACTUAL_AMOUNT"
                                         NumericType="Currency" Resizable="False" MaxLength="8" DataType="System.Decimal"  >
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="100px"  />
                                        <ItemStyle HorizontalAlign="Center" />   
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />                                                                                                                                                                                                                                                                
                                    </telerik:GridNumericColumn>                                                                                                  
                                    <telerik:GridBoundColumn DataField="STATUS" HeaderText="Status" UniqueName="STATUS"
                                         ReadOnly="true">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="90px" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridBoundColumn>                                                                    
                                    <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete"
                                         ImageUrl='../Images/deleteX.GIF' CommandName="Delete" UniqueName="Delete">
                                        <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="15px" />
                                    </telerik:GridButtonColumn>
                                    <telerik:GridBoundColumn DataField="EXPECTED_TRANSACTION_IND" UniqueName="EXPECTED_TRANSACTION_IND" ReadOnly="true"
                                       Visible="false" ForceExtractValue="Always" >
                                    </telerik:GridBoundColumn>                                       
                                </Columns>                                                                                             
                            </MasterTableView>
                            <SelectedItemStyle BackColor="#F8C320" />
                            <ClientSettings EnableRowHoverStyle="true">
                                <Selecting AllowRowSelect="true" />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
                            </ClientSettings>            
                        </telerik:RadGrid>


Thanks
Princy
Top achievements
Rank 2
 answered on 08 Dec 2010
1 answer
76 views

Hi, I have a question in regards to selective delete.  I have a grid with delete option defined as below

 

 

 

 

<telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow"

 

 

ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"

 

 

UniqueName="DeleteAlignment">

Now, I want to selectivele remove the delete option on some of the rows.  Is there a way to do that?  So I wan say delete option on the first 5 rows only... or something like that

Princy
Top achievements
Rank 2
 answered on 08 Dec 2010
8 answers
195 views
When i use GridClientSelectColumn in a RadGrid and set it to allow scroll, it will get a scroll bar for the outer body.
Detail please see the attach.

Example code to get the issue:

<telerik:RadFormDecorator ID="formdecorator" runat="server" DecoratedControls="All"
        ControlsToSkip="Zone" />
        <telerik:RadGrid ID="rgFr" runat="server" PageSize="50">   
    <MasterTableView DataKeyNames="A">
        <Columns>
            <telerik:GridClientSelectColumn ItemStyle-Width="20" />           
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true" />
        <Scrolling AllowScroll="true" ScrollHeight="300" />
    </ClientSettings>

In the code-behind:

 protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                var ds = new List<object>();
                for (int i = 0; i < 100; i++)
                {
                    ds.Add(new { A = "AA" });
                }
                this.rgFr.DataSource = ds;

                this.rgFr.DataBind();
            }
        }


Amir
Top achievements
Rank 2
 answered on 08 Dec 2010
26 answers
424 views
Hi guys,

New slider looks very tasty (in fact it all does) but can we have a two thumb version of the slider. Very useful for specifying numeric ranges ie. ring size > 4 and ring size < 8

Cheers,

Pete
Vanessa
Top achievements
Rank 1
 answered on 08 Dec 2010
1 answer
110 views

Hi,
I'm relatively new to the Radgrid and EntitySpaces. I know that they work extremely well together but I've been stumped for a few hours today with a problem. I've got a rad grid that is bound to an esDataSource, the datasource has a field that is a lookup value. I can bind the grid to the initial datasource and at this stage insertion and editing works fine. However, when I use a template column to add an dropdown control for the look up field (binding it in the ItemDataBound event handler), I can edit values well but when I insert new values though the lookup values are saved as empty values. I cant seem to grab the lookup dropdown value during the insert event.

Any suggestions would be helpful. Sample code or examples would be appriciated.

Here's my code:

<asp:Panel ID="pnlBreadcrumb" runat="server">
</asp:Panel>
  
<asp:Label ID="lblMessage" runat="server" Visible="false" Text="No list configuration found" />
  
  
<telerik:RadGrid ID="grdLevelValues" runat="server" GridLines="None" 
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
    DataSourceID="datListValues" AutoGenerateColumns="False" 
    onitemcommand="grdLevelValues_ItemCommand" 
    onitemdatabound="grdLevelValues_ItemDataBound" 
    onitemcreated="grdLevelValues_ItemCreated"    
    AllowSorting="True"
    AllowPaging="True" 
    PageSize="25"
    >
<HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>
  
<MasterTableView datakeynames="IdBusinessUnit" datasourceid="datListValues" CommandItemDisplay="Top" EditMode="InPlace">
    <Columns>
        <telerik:GridBoundColumn DataField="BusinessUnitName" HeaderText="Business Unit" 
            UniqueName="column1">            
        </telerik:GridBoundColumn>                    
        <telerik:GridTemplateColumn UniqueName="State">
            <HeaderTemplate>
                <asp:Label ID="lblStateNameHeader" Text="State Name" runat="server"></asp:Label>               
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="lblStateName" runat="server" Text='<%# Eval("UpToAddressStateItemByIdState.State") %>' />
            </ItemTemplate>
            <EditItemTemplate>
                <asp:DropDownList ID="ddlStateName" runat="server"></asp:DropDownList>
            </EditItemTemplate>
        </telerik:GridTemplateColumn
                                                                         
  
          
        <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
         
    </Columns>
  
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
  
  
  
<cc1:esDataSource ID="datListValues" runat="server" 
    onescreateentity="datListValues_esCreateEntity" 
    onesselect="datListValues_esSelect"
    AutoPaging="true" 
    AutoSorting="true"/>

code behind:
protected void Page_Load(object sender, EventArgs e)
       {
                 }
       protected void grdLevelValues_ItemCommand(object source, GridCommandEventArgs e)
       
                 }
       protected void grdLevelValues_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if ((e.Item is GridEditableItem) && e.Item.IsInEditMode)
           {
                
               AddressStateCollection states = new AddressStateCollection();
               states.Query.SelectAll();
               states.Query.Load();
               GridEditableItem gridEditableItem = (GridEditableItem)e.Item;
                  
               DropDownList dropDownList = (DropDownList)gridEditableItem["State"].FindControl("ddlStateName");
               dropDownList.DataSource = states;
               dropDownList.DataTextField = "State";                
               dropDownList.DataValueField = "IdState";
                 
               //Find the selected index by assuming that the ddl datasource will maintain the order inwhich its items were added.
               int ddlSelectedIndex =0;
               foreach(AddressStateItem state in states)
               {
                  if ((gridEditableItem.DataItem is GridInsertionObject) == false)                   
                   {
                       if (state.IdState == System.Convert.ToInt32(((Westpac.VOS.Data.BusinessUnitItem)gridEditableItem.DataItem).IdState))
                       {
                           break;
                       }
                       ddlSelectedIndex ++;
                   }
                   else
                       break;
               }
               dropDownList.SelectedIndex =  ddlSelectedIndex; 
                 
               dropDownList.DataBind();
           }   
       }
       protected void grdLevelValues_ItemCreated(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridEditableItem && e.Item.IsInEditMode)
           {
               GridEditableItem item = e.Item as GridEditableItem;
               //validation code goes here...
           }
       }
       protected void datListValues_esSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
       {
           BusinessUnitCollection values = new BusinessUnitCollection();
           values.Query.SelectAll();
           values.Query.Load();
           e.Collection = values;
         
       }
       protected void datListValues_esCreateEntity(object sender, EntitySpaces.Web.esDataSourceCreateEntityEventArgs e)
       {
           BusinessUnitItem entity = new BusinessUnitItem();
           // Insert
           if (e.PrimaryKeys == null) // A new record to be created
           {
               entity.AddNew();
               entity.IdBrand = VosContext.Current.Brand.Id;
               foreach (GridDataItem item in this.grdLevelValues.Items)
               {
                   DropDownList dropDownList = (DropDownList)item["State"].FindControl("ddlStateName");
                   if (dropDownList != null)
                   {
                       entity.IdState = System.Convert.ToInt32(dropDownList.SelectedValue);
                   }
               }  
           }
           else // Update
           {                
               entity.LoadByPrimaryKey((int)e.PrimaryKeys[0]);
               
               foreach (GridDataItem item in this.grdLevelValues.Items)
               {
                    
                    DropDownList dropDownList = (DropDownList)item["State"].FindControl("ddlStateName");
                    
                    if (dropDownList != null)
                    {
                        entity.IdState = System.Convert.ToInt32(dropDownList.SelectedValue);
                    }
                 
               }  
                  
           }
           e.Entity = entity;
       }
       

evo
Top achievements
Rank 1
 answered on 08 Dec 2010
2 answers
155 views
I have version 2008.3.1125.20 of the Telerik RadControls for ASP.NET AJAX.

Does some newer version of Telerik.Web.UI.dll support Japanese language in the chart? Currently, all I get is squares showing up in place of the actual characters.
Gregory
Top achievements
Rank 1
 answered on 08 Dec 2010
1 answer
81 views

Hi guys,
I have a following code in my aspx page:

 

<

 

telerik:GridTemplateColumn HeaderText ="Eis-Id" UniqueName ="PRICol" Groupable="true" DataField="FILENO" SortExpression="FILENO" ReadOnly="true" HeaderButtonType="TextButton">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="PRI" runat="server" ></asp:Label>

 

 

 

<asp:Image ID="Image1" runat="server" AlternateText="EIS CHARGES"/>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 


When I export grid to pdf I need to hide image label.I need just PRI label on the report.

I add some code but entire column disappeared from pdf:

DetailGrid.MasterTableView.GetColumn(

"PRICol").Visible = false;

 


Thanks so much for your help.
Daniel
Telerik team
 answered on 07 Dec 2010
1 answer
37 views
I'm exporting a radgrid to Excel successfully. This is my code
gvwMaterial.ExportSettings.ExportOnlyData = true;
gvwMaterial.ExportSettings.IgnorePaging = true;
gvwMaterial.ExportSettings.OpenInNewWindow = true;
gvwMaterial.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
gvwMaterial.ExportSettings.FileName = String.Format("File_{0}_{1}_in_{2}.xls", aaa, bbb.ToString(), ccc.ToString());
gvwMaterial.MasterTableView.ExportToExcel();

When Excel is opened, numbers with decimals, (percents like 0.12), are rounded to 0 or 1
How I can to format this columns?

Thanks

Carlos 
Daniel
Telerik team
 answered on 07 Dec 2010
3 answers
63 views
Hi .
    when i try to  bind data to grid it showing the error like this htmlfile: Unknown runtime error.It also showing error when i click the next page(paging) in grid.

Can  any one tell me what is the problem  here.And how to over come it.

Thank You.
Suresh K.
Daniel
Telerik team
 answered on 07 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?