Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
208 views
Hi, I fill RadGrid in NeedDataSource like this:

protected void rgPortConfigView_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    var grid = (RadGrid) sender;
 
    IList<Swfc_Port_ConfigInfo> lpi;
    var spc = new Swfc_Port_Config_StateController();
    var dateRange = B4DateTimePicker.DateFromDateToFromPickerOrDefault(Page, "B4DateTimePickerDatesFilter", DateTime.Now.AddDays(-6), DateTime.Now, UrlConst.DATE_FROM, UrlConst.DATE_TO);
    this.dateFrom = dateRange.DateFrom;
    this.dateTo = dateRange.DateTo;
 
    int sfSanSwitchId;
    if (int.TryParse(Request.QueryString[UrlConst.SF__SAN_SWITCH__ID], out sfSanSwitchId))
    {
        QueryParams.SetValue("SAN_SWITCH_ID", sfSanSwitchId, FilterCondition.Equal, false);
    }
    int sfSwfcPortConfigSwfcPortIndex;
    if (int.TryParse(Request.QueryString[UrlConst.SF__SWFC_PORT_CONFIG__SWFC_PORT_INDEX], out sfSwfcPortConfigSwfcPortIndex))
    {
        QueryParams.SetValue("SWFC_PORT_INDEX", sfSwfcPortConfigSwfcPortIndex, FilterCondition.Equal, false);
    }
 
    switch (SubTabID)
    {
        case "top20ports":
            lpi = spc.LoadForPerformance(0, 20, "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
        case "allports":
            lpi = spc.LoadForPerformance(0, Int32.MaxValue - 2, grid.MasterTableView.SortExpressions.GetSortString() ?? "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
        case "top10isl":
            lpi = spc.LoadForPerformanceISL(0, 10, "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
        case "top20isl":
            lpi = spc.LoadForPerformanceISL(0, 20, "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
        case "allisl":
            lpi = spc.LoadForPerformanceISL(0, Int32.MaxValue - 2, grid.MasterTableView.SortExpressions.GetSortString() ?? "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
        case "top10ports":
        default:
            lpi = spc.LoadForPerformance(0, 10, "PERFORMANCE_IOSUM DESC", this.dateFrom, this.dateTo);
            this.rgPortConfigView.DataSource = lpi;
            break;
    }
 
    QueryParams.Remove("SAN_SWITCH_ID");
    QueryParams.Remove("SWFC_PORT_INDEX");
}

Here is one of the columns that causes the mentioned exception:

<telerik:GridTemplateColumn HeaderStyle-CssClass='GridHeaderGreen la' ItemStyle-CssClass='la' UniqueName="San_Switch__DisplayName" HeaderText="Switch Name" SortExpression="SAN_SWITCH_NAME">
    <ItemTemplate>
        <asp:HyperLink ID="hlSwitchName" runat="server" Text='<%# Eval("San_Switch.DisplayName") %>' NavigateUrl='<%# GetUrlToSwitchInfo(Container.DataItem) %>' />
    </ItemTemplate>
</telerik:GridTemplateColumn>

The funny thing is that db data is returned properly from LoadForPerformance method! And there is no error in SQL part! The exception happens AFTER! The grids with using "static" ObjectDataSource work without any problem in such cases, i.e. I can indicate field names or full names, using DB schema, table name and column name like SortExpression="SF.SAN_SWITCH.NAME"...
Alexander
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
121 views
Radupload is not rendered in all versions of internet explorers. The following line below

           <telerik:RadUpload InputSize="50" runat="server" ID="radUpload1" AllowedFileExtensions=".xls,.xlsx,.xml,.csv"                                                                        ControlObjectsVisibility="None" InitialFileInputsCount="1" EnableFileInputSkinning="False">                                                     </telerik:RadUpload><br>


results in the following mark up.

<div>   <div id="ctl00_ContentArea_radUpload1" class="RadUpload RadUpload_Default"><br><span class="Apple-tab-span" style="white-space:pre">            </span><input id="ctl00_ContentArea_radUpload1_ClientState" name="ctl00_ContentArea_radUpload1_ClientState" type="hidden" /><br><span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre">   </span></div><br></div>



This works in all other browsers.

EDIT.
I changed the app to use 2012.2.724.40 and RadUpload works.


                             
Hristo Valyavicharski
Telerik team
 answered on 24 Jul 2013
2 answers
97 views
Hello.

I'm trying to use a grid with batch edit in a nestedviewtemplate, but I still can't. That's it possible? If yes, can somebody share a code or a little project?

Regards.

Angel Petrov
Telerik team
 answered on 24 Jul 2013
1 answer
103 views
We have set httpOnly for all cookies in our web.config and we have PersistStateInCookie set to true for our RadPanelBar however the cookie generated by the RadPanelBar does not seem to be httpOnly.  We verified this using FireBug in the FireFox browser.  Is this because the cookie has be accessed by javascript that Telerik is using?
Boyan Dimitrov
Telerik team
 answered on 24 Jul 2013
3 answers
390 views
I have a very basic problem in setting the width of the grid on clientside. The reason i need to set the width on client side is to decide width based on screen resolution. Everything is fine with this and I can set the width by this code piece

function gridCreated()
{

var

 

screenDivHeader = (l_screenWidth - 17);

 

 

sender.get_element().style.width = l_screenWidth +

"px";

 

 

sender.get_element().getElementsByTagName(

"div")[0].style.width = screenDivHeader + "px";

 

 

sender.get_element().getElementsByTagName(

"div")[1].style.width = l_screenWidth + "px";
}

This is working perfectly and i have no problems with that. The problem is when we have no scrollbars and grid is less than the screen width. Now i want to shrink the grid to its orginal contents and dont want it to be 100% expanded. When i do that I got the header and table of the grid out of allignment as attached in the screenshot. Please note, if I remove this line from the master page

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 


I used this javascript code to shrink the grid to original contents, this is metnieond in your forums.

sender.MasterTableView._element.style.width =

"";

 

 

sender.get_element().style.width = sender.MasterTableView._element.offsetWidth +

"px";

 



2) Second problem is that when i dont set the grid's width on server side and only set it on client side and if the scrollbar appears due to client side width setting, the frozen columns wont work. Please give me a workaround for that as well.

Your immediate response is highly appreciated.

Thanks and Regards
Venelin
Telerik team
 answered on 24 Jul 2013
9 answers
124 views
Editor-Document Manager: right to left support in IE 8,9, 10

Open the document manager and select on of the files.
Then you can notice in the file description, that there is a big space between the labels and the text-boxes.

*See the attached screenshot.

Thanks
Ianko
Telerik team
 answered on 24 Jul 2013
3 answers
154 views
I have been tasked with a portion of a product in which I think I have a solution but need a little assistance with the code design. I will describe the architecture and if you could provide some sample code in your reply that would be great. We do have the 2013 RAD AJAX Controls.

What I want to do is have a RadGrid work as a repeater control and have each row contain a RadEditor. Now, the grid will start with one empty row displayed which will allow for text to be entered. So far so good. Now, as soon as the user pastes an image, below the text, into the editor control I want a small radwindow popup to display (or hidden panel with the radio buttons on it as part of the row display) with a radio button list so the user can select the kind of image (i.e. House, Car, Boat) that was pasted in the that row's editor. After the user selects the kind of image and closes the radwindow then a new row should be inserted into the radgrid below the previously inputted row. After this new row with a fresh radeditor is displayed the user just repeats the process typing in text until the next image is pasted below the text and at that point it just repeats, a radwindow opens (or hidden panel part of the row), they select the kind of image (i.e. House, Car, Boat), then close the radwindow and have a new grid row display again. Like I stated, it may be better to have a hidden panel with radio buttons display and not have a pop up radwindow display. This is the part I am unsure of and maybe you can help me decide here as well. 

Also, at some point I will have to allow for rows to be deleted or inserted.

Can you guy's give me a simple code sample that will allow me to do this. This customer represents a big contract.

Thanks,

Steve Holdorf
lovehans@nc.rr.com
holdorfs.ctr@jdi.socom.mil
Antonio Stoilkov
Telerik team
 answered on 24 Jul 2013
1 answer
92 views
Hi,


We are using Rad control Version Q2,2013.We have noticed that there are no option available in filtering option for Numeric columns to find out TOP10/TOPn columns and BOTTOM10/BOTTOMn columns.

This will be very helpful. We hope that this will be implemented in next version of Telerik controls.


Thanks

Rajib
Maria Ilieva
Telerik team
 answered on 24 Jul 2013
7 answers
380 views
Hi,

I am looking for a way to cancel the ItemCreated and ItemDatabound event in case of exception.

The situation is as follows; I use these events to create a dynamic edit form from code behind when the user issues a grid EditCommand and to fill e. g. Comboboxes from data sources. In case of an exception I want to be able to intercept/undo the process of the edit form creation and revert the grid back to normal display mode.

As ItemCreated and ItemDatabound do not use e.Canceled I look for a different way of doing this.

Thank you

Nic
Soeren
Top achievements
Rank 1
 answered on 24 Jul 2013
3 answers
244 views
I have a page that contains a RadGrid.  One of the columns contains a hyperlink in an edit template as so:

    <telerik:GridTemplateColumn HeaderText="Asset Name" FilterControlAltText="FilterAssetName">
        <ItemTemplate>
            <asp:HyperLink ID="hplEditAsset" runat="server" ForeColor="Blue" AutoPostBackOnFilter="true"></asp:HyperLink>
        </ItemTemplate>
    </telerik:GridTemplateColumn>

I'm loading the data through a webservice, so I'd like to bind data to the grid on the client side. I'm trying to access the hyperlink in a javascript function as follows:

    function gridRowBound(sender, args) {
       var row = args.get_item()
       var link = $telerik.findElement(row , 'hplEditAsset');
       var d = args.get_dataItem();

       link.innerHtml = d.Url;
       link.outerHtml = d.UrlDescription; 
    } 

The data being bound to the grid is in the form of List<MyDataRow>, and MyDataRow has properties named Url and UrlDescription.

When I run the code, row is set to "tr#ctl00_MainContent_QuickScanGrid_ctl00__0.rgRow" according to Firebug. However, the script fails on the next line and link is never set.

How do I access that element so that I can bind the hyperlink to the data on the client side?
Steven
Top achievements
Rank 1
 answered on 24 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?