Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
128 views

I have a radgrid with batch editing and a hidden column to decide if the row can be edited.

On the clientside in the OnBatchEditSetEditorValue I check this column and set the innerHTML if the row cannot be edtied.

The trouble is after clicking on a row which cannot be edited the edit control is no longer available on other rows.

 

function BatchEditSetEditorValue(sender, args) {

    var itemContainer = args.get_container();

    var editorValue = args.get_value();

 

        var readOnlyRow = false;

        if (args.get_row().control.get_dataItem()['readOnlyRow'] != undefined) {

            readOnlyRow = args.get_row().control.get_dataItem()['readOnlyRow']

        }

        if (readOnlyRow) {

            itemContainer.innerHTML = editorValue;

            args.set_cancel(true);

        }

}

 

Is there a better way or another event I could use to stop the cell going into edit mode?

Thankyou.

David Stacey
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
83 views
Hallo,
It is my first post so Hallo!

I have a problem with radgridview.

Here is my sample code:
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
 {
            if (e.CellElement.RowInfo.Cells["io_time_sec"].Value != null)
                {
                    Int64 lTime = Convert.ToInt64(e.CellElement.RowInfo.Cells["io_time_sec"].Value);
                    Int16 nStat = Convert.ToInt16(e.CellElement.RowInfo.Cells["io_state"].Value);
 
                    if ((lTime <= 0) || (lTime >= 36000)) {
                        e.CellElement.DrawText = true;
                        e.CellElement.ForeColor = Color.Red;
                        e.CellElement.NumberOfColors = 1;
                        e.CellElement.GradientStyle = GradientStyles.Solid;
 
                    } else {
                        e.CellElement.DrawText = true;
                        e.CellElement.ForeColor = Color.Black;
                        e.CellElement.NumberOfColors = 1;
                        e.CellElement.GradientStyle = GradientStyles.Solid;
                    }
               }
}

Now I want to select the cell where I made ​​the changes.

void dgvView_Changed(object sender, CorrectDateTimeEvents e)
        {
            if (e.en == CorrectDataEventsEnum.Evt_Cancel)
            {
                winform.Close();
            }
 
            if (e.en == CorrectDataEventsEnum.Evt_OK)
            {
                radGridView1.CurrentRow.Cells["io_datein"].Value = e.valueDateIn;
                radGridView1.CurrentRow.Cells["io_dateout"].Value = e.valueDateOut;
 
                radGridView1.CurrentCell.DrawFill = true;
                radGridView1.CurrentCell.BackColor = Color.BlueViolet;
                radGridView1.CurrentCell.NumberOfColors = 1;
                radGridView1.CurrentCell.GradientStyle = GradientStyles.Solid;
                 
                winform.Close();
 
            }
        }

Everything works fine, but after I use the scrol color changes position and jumps to a random record or cell.

What am I doing wrong?



Stefan
Telerik team
 answered on 09 Jan 2014
1 answer
89 views

Hello,

 

- We have issue with Radgrid  export functionality.Please find attached code.Code contains RadAjaxPanel,RadGrid  and Blinking image as background of Rows of RadGrid.

- Export to excel is working fine.

- Issue is after clicking on any export button of grid, image stops to blink.

- After Export, if i refresh page manually, images will start to blink.

- if I placed blinking image outside of Panel, still image stop to blink.

- We need to solve issue for  IE8 and IE11 browser.

Here i have attached the source code. RadGridExport.zip


Please let me know your feedback ASAP.

Thanks,
Hiren


Viktor Tachev
Telerik team
 answered on 09 Jan 2014
7 answers
483 views
Greetings,

I understand RadGrid does not offer the possibility of exporting to a PDF template.
We'd like to add a logo (image) and certain other elements (such as Title, Sub-Title, Page count, etc.) to the header of each PDF page.

Is there a way to create a sort of Header Template during export?

Any suggestion would be most apprecicated.

Chanan Zass
Top achievements
Rank 1
 answered on 09 Jan 2014
4 answers
138 views
Hi,

I am trying to export PDF from my RadGrid and its exporting successfully. But i am facing some design issues in the exported PDF file.

1. All the text are coming with Hyperlinks in the exported PDF.
2. Set the Forecolor and width, which are not getting reflected in the exported PDF.

Below is my c# code 

protected void btnExportToPDF_Click(object sender, ImageClickEventArgs e)
        {
            ApplyStylesToPDFExport(RadGrid1.MasterTableView);
            RadGrid1.ExportSettings.OpenInNewWindow = true;
            RadGrid1.ExportSettings.IgnorePaging = true;
            RadGrid1.ExportSettings.FileName = "Test";
            RadGrid1.MasterTableView.ExportToPdf();
        }
 
private void ApplyStylesToPDFExport(GridTableView view)
        {
            GridItem headerItem = view.GetItems(GridItemType.Header)[0];
            foreach (TableCell cell in headerItem.Cells)
            {
        switch (cell.Text)
                {
                    case "A":
                        cell.Width = Unit.Pixel(5); // Tried like this. Not reflecting
                        break;
                    case "B":
                        cell.Style["width"] = "15px"; // Tried like this. Not reflecting
                        break;
        }
                cell.Style["font-family"] = "Verdana";
                cell.Style["font-bold"] = "true";
                cell.Style["text-align"] = "left";
                cell.Style["vertical-align"] = "middle";
                cell.Style["font-size"] = "8px";
                cell.ForeColor = System.Drawing.Color.Black; // Tried like this. Not reflecting
 
            }
            GridItem[] dataItems = view.GetItems(GridItemType.Item);
            foreach (GridItem item in dataItems)
            {
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["font-family"] = "Verdana";
                    cell.Style["text-align"] = "left";
                    cell.Style["vertical-align"] = "left";
                    cell.Style["font-size"] = "6px";
                    cell.Style["text-decoration"] = "none"; // Tried like this. Not reflecting
 
                    cell.Style["ForeColor"] = "#000";
                }
            }
            dataItems = view.GetItems(GridItemType.AlternatingItem);
            foreach (GridItem item in dataItems)
            {
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["font-family"] = "Verdana";
                    cell.Style["text-align"] = "left";
                    cell.Style["vertical-align"] = "middle";
                    cell.Style["font-size"] = "6px";
                    cell.Style["text-decoration"] = "none";
                    cell.ForeColor = System.Drawing.Color.Black;
                }
            }
        }

Please advise.

Thanks
Ranjith
Ranjith
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
158 views
Hello, I want to know how can i format a single week background in radcalendar.

Exemple in attach.

Thanks.

Bruno
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
338 views

Is there a way to change the Label Text of the CheckAll Checkbox to a custom text?

For example I have a list of States with checkboxes.  I want to change the default text of "Check All" to "All States".



Thanks





Glenn
Top achievements
Rank 1
 answered on 09 Jan 2014
2 answers
274 views
Hi,

I want to use load-on-demand with a web service to filter the results of my combo box as the user types in it. I have looked at the example here:
http://www.telerik.com/help/aspnet-ajax/combo_loadondemandwebservice.html

The example works fine if I only want to filter the results according to the text the user has typed. However I also need to be able to access other criteria from the user session with which to filter the data. Specifically, I need to know who the user is logged in as, so I can pre-filter the results based on which ones they are allowed to see. Their userid is held in Session state and I need to be able to retrieve it in order to narrow the results further.

The RadComboBoxContext has no property which allows me to get at the Session state, so how can I do so from within the web service method? I have seen posts elsewhere which suggest adding custom data to the context, but how is this done? How do I get my Session state data into the context in the first place?

Thanks,
S.
Otto Neff
Top achievements
Rank 2
 answered on 09 Jan 2014
2 answers
124 views
Hi,
I want to remove the dynamically created RadDock from the DockZone after clicking on the close button in RadDock. 
And I want to do this from the client side.
Please help me with Code.
Here is my Code.

            RadDock Rd = new Telerik.Web.UI.RadDock();
            Rd.EnableAnimation = true;
            Rd.Skin = "Default";
            Rd.Visible = true;
            Rd.DockMode = DockMode.Docked;
            Rd.EnableAjaxSkinRendering = false;
            Rd.OnClientDockPositionChanged = "OnClientDockPositionChanged";
            Rd.OnClientCommand = "OnClientCommand";
            RadDockZone1.Controls.Add(Rd);

<script type="text/javascript">

        function OnClientDockPositionChanged(sender, eventArgs)
       {
            var doczone = $find("<%=RadDockZone1.ClientID%>");
            var docks = doczone.get_docks().length;
            document.getElementById("<%=ltltest.ClientID%>").innerText = docks;
        }
        function OnClientCommand(sender, eventArgs)
       {
            //HERE WILL BE THE CODE WHICH WILL REMOVE THE corresponding RadDock
}


Please help me...


Thanks & Regards
Debajyoti Saha
Debajyoti
Top achievements
Rank 1
 answered on 09 Jan 2014
12 answers
442 views
Whenver I use this property editorControl.ContentFilters = EditorFilters.ConvertToXhtml;  Chrome appends <br/> to the the text. 
Ianko
Telerik team
 answered on 09 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?