Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
174 views
Hi,

    I'm using GridImageColumn in to display a icon if the value in the table is false.

Please find the aspx code below.

<

 

Telerik:RadGrid ID="TelerikThread" Width="97%" AllowSorting="True" PageSize="15"

 

 

 

OnItemDataBound="TelerikThread_ItemDataBound" AllowPaging="True"

 

 

 

AllowMultiRowSelection="True" runat="server" Gridlines="None">

 

 

<MasterTableView Width="100%" Summary="RadGrid table" AutoGenerateColumns="false" >

 

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

<Columns>

 

 

<Telerik:GridImageColumn UniqueName="GridImageColumn" SortExpression="HasRead"

 

 

 

HeaderText="Unread" DataImageUrlFields="HasRead">

 

 

</Telerik:GridImageColumn>

 


Please find the aspx.cs code below

 

protected void TelerikThread_ItemDataBound(object sender, GridItemEventArgs e)

 

 

{

 

 

if (e.Item is GridDataItem)

 

 

{

 

 

GridDataItem item = (GridDataItem)e.Item.DataItem;

 

 

 

TableCell flag = (TableCell)item["HasRead"];

 

 

 

if (flag.Text == "false")

 

 

{

 

System.Web.UI.WebControls.

Image img = (System.Web.UI.WebControls.Image)item["GridImageColumn"].Controls[0];

 

 

img.ImageUrl =

"./web/Themes/default/imges/post_status_new_ln.gif";//set image url

 

}

 

else

 

{

 

TableCell cell = (TableCell)item["GridImageColumn"];

 

 

cell.Text =

" ";//clears image column

 

}

}

}


Exception is thrown in this line

 

 

GridDataItem

 

item = (GridDataItem)e.Item.DataItem;

 

 

 


Help me with the solution

 

 

 

Tsvetina
Telerik team
 answered on 09 Mar 2011
2 answers
92 views
Hello,

I need to create my own custom appointment classes that derive from the AppointmentBase class.
What should be the using intruction to use AppointmentBase ? (using Telerik.Web.UI doesn't work)

Thanks,

Steph
Stephane
Top achievements
Rank 1
 answered on 09 Mar 2011
7 answers
241 views
Hi Telerik,

Currently I have this:

protected void RadDock_Command(object sender, DockCommandEventArgs e)
{
    switch (e.Command.Name)
    {
        case "Settings":
            RadAjaxManager1.ResponseScripts.Add("openRadWindow(\"RadDockSettings.aspx\", \"400\", \"400\")");
            break;
    }
  }
<script type="text/javascript">
    function openRadWindow(args, width, height) {
        var oWnd = radopen(args, "RadWindow1");
        oWnd.setSize(width, height);
        oWnd.center();
        oWnd.add_close(OnClientClose);
    }
 
    function OnClientClose(oWnd) {
        window.location.reload();
    }
 
    function GetRadWindow() {
        var oWindow = null;
 
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
 
    function returnToParent() {
        var oWnd = GetRadWindow();
        oWnd.close();
    }
 
</script>

This code is causing me a couple of issues:

1) The RadWindow reopens every time the page reloads -- I need to remove the ResponseScript somewhere, but where?
2) Flickering - The entire page reloads when the RadWindow is closed. I would like to just pass some information back to the page without the entire page reloading.

What's best practice for these? I've seen examples on how to open RadWindow client-side, but not through a CustomCommand click.

Thanks
Pero
Telerik team
 answered on 09 Mar 2011
1 answer
267 views
Hi

I am using the following code to select checkbox of a radgrid, but it's not working:

foreach (GridDataItem grdItem in grv_Person.Items)
            {
                if (grdItem.Cells[person_id_Column].Text == person_id)
                {
                    ((CheckBox)grdItem.Cells[2].Controls[0]).Checked = true;
                    grdItem.Selected = true;
                }
            }

I can confirm this is the last thing I do in prerender event. The grid check box just doesn't get selected

Thanks
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
1 answer
125 views
Hi,

Grouping is a great feature with rad grid! thank you!
But alignment and customizing is not very versatile.Atleast I'm finding it little round about,probly I am still a little new here.
OK,
I've used group expressions for groping data in rad grid and achieved styling and alignment to my satisfaction using itemdatabound and prerender event handler where I set the visibility of groupheader datacell to false and add the cells with required data for each column aligning the column and group header data.

So far so good,ut my problem is when I hit expand/collapse the group header datacell is blown off and my custon cell are not rendered,so I hav a blank row with expand and collapse,so I need to rebind the grid to get back the group header.

Now my thinking is if I know what event is fired when the expand/collapse is hit then I can render the group header(unfortunately when I tried the prerender event handler,I think I missed something or its the wrong event-please advise) .Please can you through some light,it feels like I'm close yet not that close-kind of stuck need this done soon-client pressure.

Thank you.
Princy
Top achievements
Rank 2
 answered on 09 Mar 2011
1 answer
95 views
how to write this staement in  $get(combo.get_id() + "_i" + i + "_chk_CheckLabel");  in C#
Shinu
Top achievements
Rank 2
 answered on 09 Mar 2011
8 answers
808 views
Hello everybody,

I have used Rad ComboBox is my application. its dropdown is showing correctly in Firefox, but not correctly in IE. Also its position is different in different devices. All devices Firefox works well.

Plz have a look at image & suggest me best to solve this.
waiting response.
Abhay
Top achievements
Rank 1
 answered on 09 Mar 2011
44 answers
1.5K+ views


The Localization of the new RadEditor "Prometheus" now works with resource files and not with XML files as before. This change was made as resources represent the standard ASP.NET 2.0 mechanism for doing this with extensive built-in support in Visual Studio. As a result, it is a much easier approach for the developer in creating or changing a localization. Another major advantage of this is it is also much easier to deploy and maintain.

The RadEditor "Prometheus" localization is contained in resource files .resx which are within the product dll. Please, note that only the English localization is built-in the control dll.

To create your own localizations for the editor, you need to create the App_Global Resources folder in the root of your web application and copy the English resx files. These files are:

  • RadEditor.Main.resx
  • RadEditor.Tools.resx

and they can be downloaded from this forum sticky note.

After you have copied the resx files, you must duplicate each copy of these files and rename them using the syntax shown in the few examples below:

  • RadEditor.Tools.<Your_Language>.resx
  • RadEditor.Main.<Your_Language>.resx

All resx file contain two columns: Name and Value as it is shown below:

The image “http://www.telerik.com/help/radcontrols/prometheus/images/Localization.png” cannot be displayed, because it contains errors.

The image “http://www.telerik.com/help/radcontrols/prometheus/images/hs-note.gif” cannot be displayed, because it contains errors. It is mandatory to set the ReservedResource string in the Name column of the RadEditor.Tools.<Language>.resx file. Without this string the resource files will not be recognized.

Once you do that you can localize the strings in the Value column. You need to localize the strings in the Value column of your new resx files.

The next step is to set the Language property of RadEditor to the name of the <localization> string in the RadEditor.Tools.<language>.resx file:
Inline in the RadEditor's declaration:
<telerik:radeditor runat="server" ID="RadEditor1" Language="it-IT"></telerik:radeditor>
In the CodeBehind:
C#: RadEditor1.Language = "it-IT";
VB.NET: RadEditor1.Language = "it-IT"

The image “http://www.telerik.com/help/radcontrols/prometheus/images/hs-note.gif” cannot be displayed, because it contains errors. If you provide a new localization for RadEditor "Prometheus" which works properly, we will gladly reward you for your work.



Rumen
Telerik team
 answered on 09 Mar 2011
2 answers
100 views
hi,
I downloaded a source code for a demo available on telerik's website which uses ASP.net AJAX, when I try to run it on my pc it gives me alot of errors, tried to fix them by adding the references again but still errors are coming. The problem is referring to a function in another class is not working. This is a picture of what is happening. 


Vasil
Telerik team
 answered on 09 Mar 2011
5 answers
151 views
Hello Telerik Admins and Members,

I have the following problem.

I set EnablePostBackOnRowClick to 'true' I also enable Client-Side row selection and I try the code below

protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label1.Text = "Aa";
    } 

in Label1 nothing changes! 
When I do the same thing in VB code it works!

Label1.Text = "Aa" is only for test...
I actually need when I click on row (currently selected row) I want the value to be shown in Label. So I guess I have 2 questions!

Barlet,
Thank you
Vasil
Telerik team
 answered on 09 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?