Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
266 views

I am using advanced binding and creating dynamic columns during Page_Init event.
Everything works fine except column groups.

I am creating column groups based on my data and then linking them to columns eventually in page_init event.

Below is the code I am trying to use. Everything is fine on first load. When we try to refresh grid, nothing works. I am getting "Invalid Column Name" error.


            DataSet dsSubmittals = new DataSet();
            DataSet dsCycles = new DataSet();
            string SubID = Session["SubmitalID"].ToString();
            if (Session["SubmitalID"] != null)
            {
                dsCycles = _dv.GetProjectCycles(ProjectID);
                //for (int k = 0; k < dsCycles.Tables[0].Rows.Count; k++)
                //{
                //    GridColumnGroup CycleGroup = new GridColumnGroup();
                //    CycleGroup.HeaderText = dsCycles.Tables[0].Rows[k]["CycleName"].ToString();
                //    CycleGroup.Name = dsCycles.Tables[0].Rows[k]["CycleID"].ToString();
                //    RadGridResults.MasterTableView.ColumnGroups.Add(CycleGroup);

                //}

                //GridColumnGroup CycleGroup1 = new GridColumnGroup();
                //CycleGroup1.HeaderText = "Final Status";
                //CycleGroup1.Name = "Final_Status";
                //RadGridResults.MasterTableView.ColumnGroups.Add(CycleGroup1);

                int index = 4;
                if (dsCycles.Tables[0].Rows.Count > 1)
                {
                    for (int j =1;j< dsCycles.Tables[0].Rows.Count; j++)
                    {

                        string colName = dsCycles.Tables[0].Rows[dsCycles.Tables[0].Rows.Count-j]["CycleName"].ToString();
                        string CycleIdValue = dsCycles.Tables[0].Rows[dsCycles.Tables[0].Rows.Count-j]["CycleID"].ToString();
                        colName = colName.Replace(" ", string.Empty);
                        bool chk = false;
                        for (int k = 0; k < RadGridResults.Columns.Count; k++)
                        {
                            if (RadGridResults.Columns[k].UniqueName != string.Empty)
                                if (RadGridResults.Columns[k].UniqueName == colName)
                                {
                                    RadGridResults.Columns[k].HeaderText = RadGridResults.Columns[k].UniqueName;
                                    chk = true;
                                    break;
                                }
                        }
                        if (!chk)
                        {
                            int loc = index + j;
                            GridBoundColumn bf = new GridBoundColumn();
                            bf.DataField = colName.Trim();
                            bf.HeaderStyle.Width = 55;
                            bf.FilterControlWidth = 22;
                            bf.UniqueName = colName.Trim();
                            bf.HeaderText = colName.Trim();
                            bf.HeaderText = colName.Trim();
                            bf.SortExpression = colName;
                            bf.FooterText = CycleIdValue;
                            bf.HeaderButtonType = GridHeaderButtonType.TextButton;
                           // bf.ColumnGroupName = "Final_Status";
                            RadGridResults.MasterTableView.Columns.AddAt(loc, bf);

                           

                        }
                    }
                }


Thanks,
Anil
Pavlina
Telerik team
 answered on 08 Oct 2014
5 answers
133 views
Hi,

I use the RadEditor inside a input form with dynamic content. Dependent of the selected record in a Radgrid different input control become visible. When an input control is not visible, its replaced to a seperate div to make room for other input controls. Because the RadEditor is replaced on the DOM I call editor.OnParentChanged() to let the RadEditor behave as expected especially in Firefox and IE 10 and lower. If I don't the RadEditor steals focus and its content becomes empty.

This works great when the RadEditor becomes visible, but when the RadEditor becomes invisible it still steals the focus.This is a problem for pressed shortkeys in the RadGrid to navigate through records because they stop work after the focus is stolen. The content of the RadEditor stays filled when it is invisible as expected.

The strange thing is, the focus is not stolen the first time the RadEditor becomes invisible.

Any ideas what goes wrong in my situation?

Ianko
Telerik team
 answered on 08 Oct 2014
1 answer
544 views
With the Microsoft Validator controls (RequiredFieldValidator in this case) the typical behavior is for validation logic to run when you tab out of the field, or on submit. 

I have noticed with RadComboBox this is **not** the case, even in your own online demo. Rather, with RCB validation *only* occurs when you attempt to submit. Is there any way to force this to validate on tab out? Typically the field would look something like this in code:

1.<telerik:RadComboBox ID="rcbPatientMaritalStatus" EmptyMessage="Start typing marital status or select one" MarkFirstMatch="true" TabIndex="8" Width="160" runat="server">
2.    <Items>
3.        <telerik:RadComboBoxItem Text="Single" Value="Single" />
4.        <telerik:RadComboBoxItem Text="Married" Value="Married" />
5.        <telerik:RadComboBoxItem Text="Other" Value="Other" />
6.    </Items>
7.</telerik:RadComboBox>
1.<asp:RequiredFieldValidator ID="rfvPatientMaritalStatus" ControlToValidate="rcbPatientMaritalStatus" ErrorMessage="Marital Status Required" Display="None" Visible="false" runat="server" />
Nencho
Telerik team
 answered on 08 Oct 2014
3 answers
213 views
Hi all, i am using Radmenu control in a project. so we have an urgent requirement from client that all the radmenu items are shows expanded. we need to show root element and its child elements and sub child elements are all expanded. so how we can achieve this functionality? Please help me its urgent task to do?
Aneliya Petkova
Telerik team
 answered on 08 Oct 2014
1 answer
82 views
Please let me know if the new appointment pop up can be changed .
I want that when i click on new appointment i should be redirected to a new page that is "NewAppointment.aspx".
i want it in a new page not in pop up.

Please let me know asap..
Boyan Dimitrov
Telerik team
 answered on 08 Oct 2014
5 answers
312 views

I pulled this below javascript from the sample article. All works well except for the grid.mastertableview. It is always null.

I have tried it with client row select enable and not.

Is there another setting on the grid that I missed to fuly activate the client side api?

Visual studio 2008 with the Telerik 2008 Q2.

Thanks for any help.

Bill


function ShowEditForm(id, rowIndex) {

var grid = window["<%= rgIncoming.ClientID %>"];

var rowControl = grid.MasterTableView.Rows[rowIndex].Control; <--Problem here

grid.MasterTableView.SelectRow(rowControl,

true);

window.radopen(

"wfProcessIncomingItemV1.aspx?AttachmentID=" + id, "wndProcessAttachment");

return false;

}

Prajakta
Top achievements
Rank 1
 answered on 08 Oct 2014
2 answers
184 views
Hi,

Has anyone tried using ESRI shape files as a datasource to populate the shapes layer?  We have a considerable number of geographical boundaries and point locations stored in ESRI shape files and would like to see if there is a reasonably simple way to use them to populate the shapes layer in the Telerik map control. 
​
Raymond
Top achievements
Rank 1
 answered on 07 Oct 2014
2 answers
147 views
Folks, using UI for ASP.NET AJAX Q2 2014 SP1 with VS 2010.

In My Radgrid, I have Cancel Confirm both for Parent and Child Grid. Cancel Confirm works well in Parent Grid. Not an issue there.

But in Child Grid,  Cancel Confirm does not work; edit form stays open. AllowAutomaticInserts="false" AllowAutomaticUpdates = "false" in Child Grid.

Below is my client side code.

function confirmCancelBackFnChild(arg) {
               // var grid = $telerik.findControl(document.body, "RadGrid2");
               var grid = $find("<%= RadGrid1.ClientID %>");
               if (arg)
               {
                   var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                   var detailTable = grid.get_detailTables()[0];
                   var detailtableName = detailTable.get_name();
 
                   // alert(detailtableName);
                   document.getElementById('<%=HiddenField1.ClientID%>').value = "true";
 
                   // detailTable.fireCommand("CancelConfirmed", 0);
                   detailTable.fireCommand("CancelConfirmed", String.Empty);
 
               }
 
               else
               {
 
                   document.getElementById('<%=HiddenField1.ClientID%>').value = "false";
 
               }
 
               document.getElementById('<%=HiddenField1.ClientID%>').value = "false";
           }


Below is my Item command for the Command for the Child Grid.

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        RadGrid grid = (source as RadGrid);
         
        if (true && e.Item.OwnerTableView.Name == "DemographicsDependants") // Child Table
        {
            switch (e.CommandName)
            {
                case "Cancel":
                    int searchlocation = 0;
                    string[] retrievedLocations = (string[])Session["LocationData"];
                    Array.Sort(retrievedLocations);
 
                    string location = Session["SessionOtherInfoFacilityName"].ToString().Trim();
                    searchlocation = Array.BinarySearch(retrievedLocations, location);
 
                    //  if (HiddenField1.Value == "false" && searchlocation >= 0)
                    if (HiddenField1.Value == "false")
                    {
                        e.Canceled = true;
                        Session["savedIndex"] = e.Item.ItemIndex;
                        RadWindowManager1.RadConfirm("Continue with Cancel in Child Table? Warning, you will loose any unsaved work!!!", "confirmCancelBackFnChild", 350, 150, null, "Cancel Confirm");
                    }
                    break;
                case "CancelConfirmed":
                    foreach (GridEditableItem item in RadGrid1.MasterTableView.DetailTables[0].GetItems(GridItemType.EditFormItem))
                    {
                        if (item.IsInEditMode && item.ItemIndex == (int)Session["savedIndex"])
                        {
                            item.FireCommandEvent("Cancel", String.Empty);
                        }
                    }
                    // HiddenField1.Value = "false";
                      
                    break;
            }
        }
    }


Thanks for any Help.

gc_0620










gc_0620
Top achievements
Rank 1
 answered on 07 Oct 2014
1 answer
120 views
Hi,

I am trying to use a PanelBar from one of the samples.
I need just one panel to make it a collapsible panel for advanced options.

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="SingleExpandedItem" Width="100%">
        <Items>
            <telerik:RadPanelItem Expanded="false" Text="Advanced Settings" runat="server">
                <Items>
                    <telerik:RadPanelItem Value="AccountInformation" runat="server">
                        <ItemTemplate>
[I have a table here]
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
</telerik:RadAjaxPanel>

I can click on the panelBar to extend it, but it does not want to collapse.

Is the PanelBar the correct control for this ?
Or am I doing something wrong ?

Mickael
Top achievements
Rank 1
 answered on 07 Oct 2014
3 answers
127 views
Hello everybody,

i use the telerik RadScheduler and the Timeline-View.

I will export the current view to PDF. The HTML-View shows all correct.
In the PDF the inline row of the timeline is smaller then the vertical headers. (Take a look to the Attachment)

The html and pdf have the same css files.

My C# code:
RadScheduler1.ExportSettings.Pdf.PaperSize = SchedulerPaperSize.A4;
RadScheduler1.ExportSettings.Pdf.PaperOrientation = SchedulerPaperOrientation.Landscape;
 
RadScheduler1.ExportSettings.Pdf.PageTopMargin = Unit.Parse("10mm");
RadScheduler1.ExportSettings.Pdf.PageBottomMargin = Unit.Parse("10mm");
RadScheduler1.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("10mm");
RadScheduler1.ExportSettings.Pdf.PageRightMargin = Unit.Parse("10mm");
RadScheduler1.ExportSettings.Pdf.AllowPaging = true;
RadScheduler1.RowHeaderWidth = Unit.Parse("45mm");
RadScheduler1.Width = Unit.Parse("200mm");
 
SqlDSEmployee.SelectCommand = sql();
SqlDSEmployee.DataBind();
 
RadScheduler1.ExportToPdf();


My aspx:

<ExportSettings OpenInNewWindow="True">
             <Pdf PageTopMargin="10mm" PageBottomMargin="10mm" PageLeftMargin="10mm" PageRightMargin="10mm"
                    PaperSize="A4" StyleSheets="Content/StylePDF.css">
            </Pdf>
</ExportSettings>

What can I do? Is this a problem with the PDF-Exporter?

Best regards
Tobias
Plamen
Telerik team
 answered on 07 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?