Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
268 views
Hello,

I've got a RadMultiPage that displays it's RadPageViews based on a tab selected in a RadTabStrip.
What I want to know is if every RadPageView loads all at once (When the RadMultiPage loads) or do they load individually based on the tab that is selected in the RadTabStrip.

I am trying to create a wizard and I want to know if it would be wise to use the RadPageView_Load event to handle methods for an individual RadPageView.
Say I have a RadPageView called "Step2RadPageView". What if I wanted to run certain methods ONLY when this PageView is Selected?

Similar to using a normal asp.net MultiView and using the View.Activate event.

Thanks in advance.
Cody
Top achievements
Rank 1
 answered on 17 Mar 2014
3 answers
90 views
I'm creating a new project and including the RadEditor with it. I'm experiencing 2 issues and I hope that you can help me with these. The first issue is that when I declare the DeletePaths, UploadPaths and ViewPaths with "~/Images/Sections" I get the error "Invalid characters in the filename", however it takes me to that folder after the error. If I change the path to "~/Images" it works without the error. The second issue is that the upload and delete buttons are disabled. For all the other Managers (ie, documents, flash, media and templates) everything works?

Here is where I declare my paths
<ImageManager DeletePaths="~/Images/Sections" MaxUploadFileSize="1000000" UploadPaths="~/Images/Sections" ViewPaths="~/Images/Sections" />

Here is the code behind
Dim imagepath() As String = {"~/Images/Sections"}
 
If Not IsPostBack Then
    RadEditor1.ImageManager.ViewPaths = imagepath
End If

I've spent hours going over the forum and trying everything, but nothing seems to work. All my work so far has been on the localhost.

William
Ianko
Telerik team
 answered on 17 Mar 2014
2 answers
155 views
Hello,
I have a RadHtmlChart in which i dinamically create LineSeries. I have successfully set Chart.PlotArea.YAxis.MaxValue and Chart.PlotArea.YAxis.MinValue, but XAxis.MinValue does not work. I'd like to start the series in a way that the first value "thouches" the y-axis. Because in xaxis i have 2006 as first year, I tried to set XAxis.MinValue = 2006, but I always got a gap between the y-axis and the first value in the chart (it seems that the start of xaxis is the half of 2005). I see the same gap at the end of the chart.

In attachment the screenshot of chart.

Thanks
Danail Vasilev
Telerik team
 answered on 17 Mar 2014
2 answers
221 views
The Example of keeping the expanded/collapse state of groups that Telerik provide uses the viewstate. If you have viewstate disabled, it causes a few kinks. Since I had to write this myself, I figured I'd share in case anyone needed it.

These two were in a class call telerikhelpers but you could put them anywyere
    /// <summary>
/// this loads the saved states of the group headers
/// (whether they were collapsed or expanded) you have to pass in the
/// grid you want to bind
/// </summary>
/// <param name="grid">the grid you want to bind</param>
public static void LoadGroupsExpandedState(RadGrid grid)
{
    var listCollapsedIndexes = HttpContext.Current.Session[grid.ID] as ArrayList;
 
    if (listCollapsedIndexes != null)
    {
        foreach (GridItem item in grid.MasterTableView.GetItems(GridItemType.GroupHeader))
        {
            if (listCollapsedIndexes.Contains(item.RowIndex))
            {
                item.Expanded = false;
            }
        }
    }
}//LoadGroupsExpandedState
 
/// <summary>
/// this function sets a session variable to remember which grouping items have been
/// collapsed or expanded
/// </summary>
/// <param name="grid"></param>
/// <param name="curItem"></param>
public static void SaveGroupsExpandedState(RadGrid grid, GridItem curItem)
{
    GridItem[] groupItems = grid.MasterTableView.GetItems(GridItemType.GroupHeader);
    if (groupItems.Length > 0)
    {
 
        var listCollapsedIndexes = new ArrayList();
 
        //if this first one is true, then we need to add it to the list
        //basically the state that is getting passed in is the old state
        //so if it's expanded = true, then it was expanded, and it's
        //getting collapsed
        if (curItem.Expanded)
        {
            listCollapsedIndexes.Add(curItem.RowIndex);
        }//if curItemExpanded
        else
        {
            //check if it's in the list
            if (listCollapsedIndexes.Contains(curItem.RowIndex))
            {
                listCollapsedIndexes.Remove(curItem.RowIndex);
            }//if listCollapse
        }//else
 
 
        foreach (GridItem item in groupItems)
        {
            if (!item.Expanded && item.RowIndex != curItem.RowIndex)
            {
                listCollapsedIndexes.Add(item.RowIndex);
            }
        }
        HttpContext.Current.Session[grid.ID] = listCollapsedIndexes;
    }
}//SaveGroupsExpandedState


Then attach these two functions to your itemdatabound and databound events on the acutal grid itself

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    //get the grid
    RadGrid grid = sender as RadGrid;
 
    //if this is expand or collapse, save the state
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
        TelerikHelpers.SaveGroupsExpandedState(grid, e.Item);
    }
 
}//ItemCommand
 
/// <summary>
/// This method adds logic on how to handle a databound (restore the grouping set on screen)
/// </summary>
///The parameter is not used.
///The parameter is not used.
protected void RadGrid1_DataBound(object sender, EventArgs e)
{
    TelerikHelpers.LoadGroupsExpandedState(sender as RadGrid);
}

If you make the first two accessible globally, you can literally attach multiple grids on a page to the same databound and item command events and it will just work. Hope this helps someone else!

Konstantin Dikov
Telerik team
 answered on 17 Mar 2014
3 answers
185 views
There are a few old threads up here - one from 2008 or 2009 stating that the RadGrid ExcelML export does not support line break characters.  Is this still the case?

I have a few cells that have line breaks I would like to bring through the ExcelML export - and have tried several approaches, but no luck.

Is this still an unsupported scenario?
Kostadin
Telerik team
 answered on 17 Mar 2014
2 answers
104 views
I'm watching the demo "MediaPlayer - Video Gallery" (http://demos.telerik.com/aspnet-ajax/media-player/examples/applicationscenarios/video-gallery/defaultcs.aspx), in the RadLightBox pop up the volumen bar and the progressrail bar didn't work. I'm using IE 11.

I'm built my own webapp and I found the same problem.
Eyup
Telerik team
 answered on 17 Mar 2014
4 answers
1.5K+ views
I've got a RadGrid on my page with one level of DetailTables.  Each detail table has a chevron next to it that collapses that table.  I'd like to have a chevron on the master table that expands or collapses all the detail tables (if any are expanded, it collapses them all; otherwise, it expands them all).  Is this a setting that can be set?  I would rather have the same look and feel, rather than using a button to expand or collapse all the tables. 
Eyup
Telerik team
 answered on 17 Mar 2014
1 answer
120 views
Hi.

My requirement is for a grid that will be dynamically populated,
Because of this I build the entire grid in my code behind.

I have this 99% working except for this issue with grouping:

When I group by a column and expand the group, then collapse the same group again it will collapse without any problem.

I also have these tabs which is essentially just a string value that I pass in from a hidden field it can optionally be used as a filter when I bring back a search result that will populate my grid.

The problem come in when I pass in this string; I am able to expand any of my groups, but when I want to collapse the group the page posts back but does not collapse the group again.
protected void Page_Init(object sender, System.EventArgs e)
       {
              string filterValue = HorizontalTabFilter();
               string verticalFilterValue = VerticalTabFIlter();
 
 
           DefineGridStructure();
 
       }
 
 
private void DefineGridStructure()
       {
           string searchColumns = gf.GetConfigValue(HttpContext.Current.Session["APPLICATION"].ToString(), "SEARCHCOLUMNS");
           List<string> searchColumnList = searchColumns.Split('|').ToList();
 
           RadGrid grid = new RadGrid();
           grid.ID = "RadGrid1";
           grid.AllowSorting = true;
           grid.GroupingEnabled = true;
           grid.ClientSettings.AllowGroupExpandCollapse = true;
           grid.ClientSettings.AllowDragToGroup = true;
           grid.ClientSettings.Scrolling.AllowScroll = true;
           grid.ClientSettings.Scrolling.UseStaticHeaders = true;
           grid.ClientSettings.Scrolling.SaveScrollPosition = true;
           grid.ClientSettings.Scrolling.EnableVirtualScrollPaging = true;
           grid.ClientSettings.Resizing.ResizeGridOnColumnResize = true;
           grid.ClientSettings.Resizing.AllowColumnResize = true;
           grid.ClientSettings.Resizing.EnableRealTimeResize = true;
           grid.ClientSettings.Resizing.ResizeGridOnColumnResize =  true;
           grid.ClientSettings.Resizing .AllowResizeToFit = true;
           grid.HorizontalAlign = HorizontalAlign.Left;
           grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
           grid.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
           grid.AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Left;
           grid.EnableViewState = true;
 
if (selectedTab != "" || selectedVerticalTab != "")
           {
               grid.DataSource = null;
               grid.Rebind();
           }
 
 
           grid.DataSource = dt = ed.SearcheDOCS(selectedTab, selectedVerticalTab, selectedVerticalTabIndex);
 
           colCount = dt.Columns.Count;
           rowCount = dt.Rows.Count;
 grid.Width = Unit.Percentage(99);
           grid.Height = Unit.Percentage(99);
           grid.PageSize = Convert.ToInt32(gf.GetConfigValue(HttpContext.Current.Session["APPLICATION"].ToString(), "PAGINATION"));
           if (Convert.ToInt32(gf.GetConfigValue(HttpContext.Current.Session["APPLICATION"].ToString(), "PAGINATIONALLOWED")) == 1)
           {
               grid.AllowPaging = true;
           }
           else
           {
               grid.AllowPaging = false;
           }
           grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
           grid.AutoGenerateColumns = false;
           grid.ShowGroupPanel = true;
           grid.HeaderStyle.CssClass = "HEADER";
           grid.MasterTableView.Width = Unit.Percentage(100);
           grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
           grid.MasterTableView.DataKeyNames = new string[] { "DOCNUM" };
            
           GridBoundColumn boundColumn = new GridBoundColumn();
           GridImageColumn gi;
           GridButtonColumn gb;
           GridHyperLinkColumn hyperlinkColumn;
 
           boundColumn = new GridBoundColumn();
           gi = new GridImageColumn();
           gb = new GridButtonColumn();
           hyperlinkColumn = new GridHyperLinkColumn();
           grid.MasterTableView.TableLayout = GridTableLayout.Fixed;
           grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
           GridTableView tableViewOrders = new GridTableView(grid);
           grid.MasterTableView.Columns.Add(boundColumn);
 
 
           if (colCount == 10)
           {
               boundColumn.DataField = "icon";
               boundColumn.HeaderText = "icon";
               boundColumn.Visible = false;
               boundColumn.FilterImageUrl = "icon_icon.gif";
 
               string[] fld0 = { "icon" };
               gi = new GridImageColumn();
               gi.DataImageUrlFields = fld0;
               gi.DataImageUrlFormatString = "~/images/{0}";
               gi.HeaderText = "";
 
               gi.HeaderStyle.Width = Unit.Pixel(30);
               gi.ImageHeight = Unit.Pixel(20);
               gi.ImageWidth = Unit.Pixel(20);
 
               grid.MasterTableView.Columns.Add(gi);
 
               grid.MasterTableView.GroupsDefaultExpanded = false;
               GridGroupByExpression expression = new GridGroupByExpression();
               GridGroupByField gridGroupByField = new GridGroupByField();
               gridGroupByField = new GridGroupByField();
               gridGroupByField.FieldName = "AUTHOR";
               gridGroupByField.HeaderText = "AUTHOR";
               expression.SelectFields.Add(gridGroupByField);
 
               gridGroupByField = new GridGroupByField();
               gridGroupByField.FieldName = "AUTHOR";
               gridGroupByField.HeaderText = "AUTHOR";
               expression.GroupByFields.Add(gridGroupByField);
 
               boundColumn = new GridBoundColumn();
               grid.MasterTableView.Columns.Add(boundColumn);
               boundColumn.DataField = "application";
               boundColumn.HeaderText = searchColumnList[0].ToString();
               boundColumn.Visible = false;
 
               boundColumn = new GridBoundColumn();
               grid.MasterTableView.Columns.Add(boundColumn);
               boundColumn.DataField = searchColumnList[1].ToString();
               //boundColumn.ItemStyle.Width = Unit.Pixel(70);
               boundColumn.HeaderStyle.Width = Unit.Pixel(70);
               boundColumn.HeaderText = gf.GetHeadingText(searchColumnList[1].ToString());
 
               string[] fld = { "link" };
               hyperlinkColumn.DataNavigateUrlFields = fld;
               hyperlinkColumn.ItemStyle.CssClass = "hyperlink";
               hyperlinkColumn.DataNavigateUrlFormatString = "{0}";
               hyperlinkColumn.HeaderText = gf.GetHeadingText(searchColumnList[2].ToString());
               hyperlinkColumn.ItemStyle.Width = Unit.Pixel(300);
               hyperlinkColumn.HeaderStyle.Width = Unit.Pixel(300);
               hyperlinkColumn.DataTextField = "DOCNAME";
               hyperlinkColumn.AllowSorting = true;
               hyperlinkColumn.ItemStyle.Wrap = false;
               grid.MasterTableView.Columns.Add(hyperlinkColumn);
 
               hyperlinkColumn = new GridHyperLinkColumn();
               string[] fld4 = { "ABSTRACTLINK" };
               hyperlinkColumn.DataNavigateUrlFields = fld4;
               hyperlinkColumn.ItemStyle.CssClass = "hyperlink";
               hyperlinkColumn.DataNavigateUrlFormatString = "{0}";
               hyperlinkColumn.HeaderText = "Comments";
               hyperlinkColumn.HeaderStyle.Width = Unit.Pixel(75);
               hyperlinkColumn.ItemStyle.Width = Unit.Pixel(75);
               hyperlinkColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
               hyperlinkColumn.DataTextField = "ABSTRACT";
               hyperlinkColumn.AllowSorting = true;
               hyperlinkColumn.ItemStyle.Wrap = false;
               grid.MasterTableView.Columns.Add(hyperlinkColumn);
 
               hyperlinkColumn = new GridHyperLinkColumn();
               string[] fld2 = { "editlink" };
               hyperlinkColumn.DataNavigateUrlFields = fld2;
               if (gf.GetConfigValue(HttpContext.Current.Session["APPLICATION"].ToString(), "ALLOWEDIT") == "0")
               {
                   hyperlinkColumn.Visible = false;
               }
               hyperlinkColumn.DataNavigateUrlFormatString = "{0}";
               hyperlinkColumn.HeaderText = "Edit";
               hyperlinkColumn.HeaderStyle.Width = Unit.Pixel(45);
               hyperlinkColumn.ItemStyle.Width = Unit.Pixel(45);
               hyperlinkColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
               hyperlinkColumn.DataTextField = "editlink";
               hyperlinkColumn.ImageUrl = "~/images/EditProfile2.png";
               grid.MasterTableView.Columns.Add(hyperlinkColumn);
 
               hyperlinkColumn = new GridHyperLinkColumn();
               string[] fld3 = { "versionLink" };
               hyperlinkColumn.DataNavigateUrlFields = fld3;
               if (gf.GetConfigValue(HttpContext.Current.Session["APPLICATION"].ToString(), "ALLOWVERSION") == "0")
               {
                   hyperlinkColumn.Visible = false;
               }
               hyperlinkColumn.DataNavigateUrlFormatString = "{0}";
               hyperlinkColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
               hyperlinkColumn.HeaderStyle.Width = Unit.Pixel(55);
               hyperlinkColumn.ItemStyle.Width = Unit.Pixel(55);
               hyperlinkColumn.HeaderText = "Version";
               hyperlinkColumn.DataTextField = "versionLink";
               hyperlinkColumn.ImageUrl = "~/images/NewVersion2.png";
               grid.MasterTableView.Columns.Add(hyperlinkColumn);
 
               boundColumn = new GridBoundColumn();
               grid.MasterTableView.Columns.Add(boundColumn);
               boundColumn.DataField = "link";
               boundColumn.HeaderText = "Link";
               boundColumn.Visible = false;
 
               boundColumn = new GridBoundColumn();
               grid.MasterTableView.Columns.Add(boundColumn);
               boundColumn.DataField = "ABSTRACTLINK";
               boundColumn.HeaderText = "ABSTRACTLINK";
               boundColumn.Visible = false;
               this.PlaceHolder1.Controls.Add(grid);
           }

On page Page_Init I use  DefineGridStructure(); to build my grid and bind the datatable that comes from ed.SearcheDOCS(selectedTab, selectedVerticalTab, selectedVerticalTabIndex);

Then depending on the number of columns returned I build the grid,
when one of these filter values I mentioned above is passed in while grouped I use the code below, so when it posts back to collapse after having been expanded the code runs as expected but will not collapse the expanded group.
if (selectedTab != "" || selectedVerticalTab != "")
{
    grid.DataSource = null;
    grid.Rebind();
} grid.DataSource = dt = ed.SearcheDOCS(selectedTab, selectedVerticalTab, selectedVerticalTabIndex);
I could really use some help with this.
Any ideas?
Viktor Tachev
Telerik team
 answered on 17 Mar 2014
3 answers
85 views
I'm currently upgrading Telerik for our company, however it looks like the combo box layout that we used to use isn't there anymore.

I was hoping we would have the images that were used here, however it looks like we are missing those.

Attached is a screenshot of the combobox that we are using.
Magdalena
Telerik team
 answered on 17 Mar 2014
3 answers
821 views
Hi,

I am using Rad-grid hierarchical. when i am trying to rebind the grid after update or insert. i am getting "FixedId" is neither a DataColumn nor a data Relation"  Here i added my design and code behind please let me know where i am going wrong.
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Skin="Black" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
    AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false"
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand" OnDataBound="RadGrid1_DataBound"
    OnPreRender="RadGrid1_PreRender" >
 
    <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Fixed" AllowMultiColumnSorting="True" EditMode="InPlace" >
        <DetailTables>
            <telerik:GridTableView DataKeyNames="FixedId" CommandItemDisplay="Top"  TableLayout="Fixed" Name="Fixed" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false">
                <Columns>
                    <telerik:GridTemplateColumn Visible="false">
                        <ItemTemplate>
                            <asp:Label ID="lblFixedId" runat="server" Text='<%#Eval("FixedId") %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" ItemStyle-Width="25px" HeaderStyle-HorizontalAlign="Center"
                        EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');"
                                ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                     
                    <telerik:GridTemplateColumn UniqueName="Jan" HeaderText="Jan" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="70px">
                        <ItemTemplate>
                            <asp:Label ID="lblJan" runat="server" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("Jan"))) %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtJanEdit" Width="70px" runat="server" MaxLength="11" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("Jan"))) %>' CssClass="AlgRgh"
                                onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="txtJanInsert" runat="server" Width="70px" MaxLength="11" CssClass="AlgRgh"
                                onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                        </InsertItemTemplate>
                        <FooterTemplate>
                            <asp:Label ID="lblJanFooter" runat="server"></asp:Label>
                        </FooterTemplate>
                    </telerik:GridTemplateColumn>
                    
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false">
                <ItemTemplate>
                    <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                <ItemTemplate>
                    <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="140px" HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                <ItemTemplate>
                    <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label>
                </FooterTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderStyle-Width="60" UniqueName="Jan" HeaderText="" ItemStyle-HorizontalAlign="Right"
                HeaderStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right"
                Aggregate="Sum" DataField="Jan" FooterAggregateFormatString="{0:n}">
            </telerik:GridTemplateColumn>
           
 
        </Columns>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true">
        
    </ClientSettings>
</telerik:RadGrid>

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                //DGeneral gen = new DGeneral();
                //RadGrid1.DataSource = gen.GetAccountDetailsbyTabName("Fixed");
                Dfixed fix = new Dfixed();
                RadGrid1.DataSource = fix.GetFixedAccountsDetails(Convert.ToInt32(Session["Propertyid"].ToString()), Convert.ToInt32(Session["BudgetYear"].ToString()));
            }
        }
 
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            Dfixed fix = new Dfixed();
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "Fixed":
                    {
                        int AccountID = Convert.ToInt32(dataItem.GetDataKeyValue("TempAccountsId").ToString());
                        e.DetailTableView.DataSource = fix.GetFixedByAccountId(AccountID, Convert.ToInt32(Session["BudgetYear"].ToString()), Convert.ToInt32(Session["Propertyid"].ToString()));
                        break;
                    }
 
                case "OrderDetails":
                    {
                        //string OrderID = dataItem.GetDataKeyValue("OrderID").ToString();
                        //e.DetailTableView.DataSource = GetDataTable("SELECT * FROM [Order Details] WHERE OrderID = " + OrderID);
                        break;
                    }
            }
        }
 protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            string exepUpdate = "";
            try
            {
                if (e.CommandName.Equals(RadGrid.UpdateCommandName))
                {
                    if (e.Item.OwnerTableView.Name == "Fixed")
                    {
                        bool ResultSuccess = false;
                        Dfixed fix = new Dfixed();
                        GridEditableItem item = e.Item as GridEditableItem;
                        Label lblFixedId = (Label)item.FindControl("lblFixedId");
                        int GenId = Convert.ToInt32(lblFixedId.Text.Trim().ToString());
                        TextBox txtDescriptionEdit = (TextBox)item.FindControl("txtDescriptionEdit");
                        TextBox txtJanEdit = (TextBox)item.FindControl("txtJanEdit");
                        if (txtJanEdit.Text.Trim().ToString() != string.Empty)
                        {
                            Jan = Convert.ToDouble(txtJanEdit.Text.Trim().ToString());
                        }
                        
                        total = Jan + Feb + Mar + Apr + May + Jun + July + Aug + Sep + Oct + Nov + Dec;
 
                        long? Retablesqfeet = fix.GetPropertyRentalsqfeet(Convert.ToInt32(Session["Propertyid"].ToString()));
 
                        double? genpersqft = total / Retablesqfeet;
 
                        ResultSuccess = fix.EditFixedDetails(GenId, Jan, Feb, Mar, Apr, May, Jun, July, Aug, Sep, Oct, Nov, Dec, total, genpersqft, txtDescriptionEdit.Text.Trim().ToString());
                        if (ResultSuccess)
                        {
                             RadGrid1.Rebind();
 
                        }
                        else
                        {
                            DisplayMessage("Please Verify the values");
                            e.Canceled = true;
                        }
                    }
                }
            }
            catch (Exception)
            {
                exepUpdate = "Please Verify the values you have changed in editable fields";
            }
            finally
            {
                if (exepUpdate != "")
                {
                    e.Canceled = true;
                    DisplayMessage("Fixed Record cannot be Updated. Reason: " + exepUpdate.ToString());
                }
            }
 
 
 
        }

 
Eyup
Telerik team
 answered on 17 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?