Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
135 views
I have an ASP.NET image control in a templated column within RadGrid (lastest release)

I have been able to adjust the background color of the cell as shown in the code below. However, the client prefers that I use customized icons that would vary based on several data conditions.

I am hoping there is a way that I can access the ImageUrl property of the control in this cell.
 
Note that this control differs from my color-coding example quoted below, but I think that whatever statement I need would fit into that overall logic.

 

<telerik:GridTemplateColumn DataField="id"
    FilterControlAltText="Filter column column" HeaderText="Info"
    UniqueName="ID_column" SortExpression="id">
    <ItemTemplate>
           <asp:Image ID="targetControl" runat="server" ImageUrl="images/info16.gif" />
    </ItemTemplate>
Protected Sub Event_Grid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles Event_Grid.ItemCreated
    Dim Temp As String = Nothing
    Dim Event_Date As Date = Nothing
    Dim End_Date As Date = Nothing
    If TypeOf (e.Item) Is GridDataItem Then
        Try
            Event_Date = CDate(e.Item.DataItem("event_date_sort"))
            End_Date = CDate(e.Item.DataItem("end_date"))
            Dim gdi As GridDataItem = CType(e.Item, GridDataItem)
            If End_Date < Today Then
                gdi.Cells(2).BackColor = System.Drawing.Color.Silver
            ElseIf (End_Date >= Today) And (Event_Date <= Today) Then
                gdi.Cells(2).BackColor = System.Drawing.Color.PaleGreen
            ElseIf Event_Date < DateAdd(DateInterval.Month, 1, Today) Then
                gdi.Cells(2).BackColor = System.Drawing.Color.Yellow
            Else
                gdi.Cells(2).BackColor = System.Drawing.Color.WhiteSmoke   
            End If
            If e.Item.DataItem("type_code") = "x" Then
                gdi.Cells(2).BackColor = System.Drawing.Color.Tomato
            End If
        Catch ex As Exception
            'leave default shading
        End Try
    End If
End Sub

Tomica
Top achievements
Rank 2
 answered on 28 Aug 2012
0 answers
62 views
Hi!

How can I change the background color of the menu in css without using images or sprites, only with RGB codes?

The menu is always gray :( I can change the color when it is selected but the background and borders are always gray.

Thanks.
João
João
Top achievements
Rank 1
 asked on 28 Aug 2012
9 answers
213 views
Hi,

I am binding AutoCompleteBox  with my DB. In my table there are names like( xyz's company,robin's house etc.).
When i type x it shows me the name list but when i select the xyz's company i just got error because of single quotes.

Please help!!!!!!!!

Thanks in Advance.


 
Kalina
Telerik team
 answered on 28 Aug 2012
1 answer
85 views
I have a situation where I need to only allow the selection of items in a RadTreeList that the user is authorized to select.  I looped through the data and disabled all the dataitems that the user wasn't authorized to access and I thought everything was working fine until I clicked the checkbox in the header that is used to select all items.

Apparently, it's still marking all the "rows" as selected even though they are disabled.  I'm pretty sure this checkbox is javascript driven and I was able to capture the click via one of the client-side events, but I cannot find documented anywhere a javascript method/property that will allow me to determine if the item is enabled or not.  That way, I could just undo the selection.

This was fairly straightforward with a treeview control (which I cannot use for this particular data) because it had properties (eg get_enabled) that was accessible for that control, but doesn't appear to be available for RadTreeList

Any suggestions?  I need a solution quick because this is being raised as a stop-ship defect
Tsvetina
Telerik team
 answered on 28 Aug 2012
2 answers
68 views
Hi,

We are going to use wcf services to bind appointments in the calendar.

For this we have given

    <WebServiceSettings Path="CalendarService.svc" ResourcePopulationMode="ServerSide" />

Now we are using wcf service hosted inside our website.

So we want to know that whether we can use a webservice hosted separate in IIS? not inside our website?


Thanks,
Mahesh 
Genady Sergeev
Telerik team
 answered on 28 Aug 2012
1 answer
99 views
We have popup edit grid, In which we allow user to upload mulitple files. User can click any row in grid so that popup will appear and he can select multiple files. We have achieved this in our application. Howerver, we want user to view attached files after uploading but we could not succeed.

Can you please help us in this regard. Thanking you in advance.
Kostadin
Telerik team
 answered on 28 Aug 2012
1 answer
79 views
Is there a way to show/hide the scrollbar based on the RadPageView's length? Say I only want to see them when the content is longer than the page width.

Thanks,
Rut
Kate
Telerik team
 answered on 28 Aug 2012
2 answers
67 views
Hi,

I am using get_allNodes() and it appears to only return root and expanded nodes (it's not returning any children of collapsed parent nodes). At least, this is the count that nodes.length is giving me. Is this expected behavior?

Thanks,
Ted
Ted
Top achievements
Rank 1
 answered on 28 Aug 2012
6 answers
157 views
export to excel,pdf,csv are not working.  below is the code sample.

 

 

<asp:UpdatePanel runat="server"><ContentTemplate>
<telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="true" Skin="Outlook"
    AutoGenerateColumns="False" PageSize="12" AllowSorting="True" AllowMultiRowSelection="False"
    AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource" 
    OnItemCommand="RadGrid1_ItemCommand" AllowFilteringByColumn="True">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true"/>
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="false"/>
        </ClientSettings>
  
    <MasterTableView Width="100%" DataKeyNames="intID" AllowMultiColumnSorting="True" CommandItemDisplay="Top"
        CommandItemSettings-ShowExportToExcelButton="true" CommandItemSettings-ShowAddNewRecordButton="false" UseAllDataFields="true">
    <Columns>
        <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column" />
        <telerik:GridBoundColumn SortExpression="strSiteID" HeaderText="Location" HeaderButtonType="LinkButton"
            DataField="strSiteID">
        </telerik:GridBoundColumn>
        <telerik:GridDateTimeColumn  SortExpression="dtInvoiceDate" HeaderText="Invoice Date" HeaderButtonType="LinkButton"
            DataField="dtInvoiceDate" DataFormatString="{0:d}" PickerType="DatePicker" FilterControlWidth="100px" >
        </telerik:GridDateTimeColumn>
        <telerik:GridBoundColumn SortExpression="strInvoiceNo" HeaderText="Invoice" HeaderButtonType="LinkButton"
            DataField="strInvoiceNo">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="strItemNo" HeaderText="Part #" HeaderButtonType="LinkButton"
            DataField="strItemNo">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="intItemCount" HeaderText="QTY" HeaderButtonType="LinkButton"
            DataField="intItemCount">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="strCondition" HeaderText="Condition" HeaderButtonType="LinkButton"
            DataField="strCondition">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="strStatus" HeaderText="Status" HeaderButtonType="LinkButton"
            DataField="strStatus">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="strETA" HeaderText="ETA" HeaderButtonType="LinkButton"
            DataField="strETA">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression="strBoxID" HeaderText="Box ID" HeaderButtonType="LinkButton"
            DataField="strBoxID">
        </telerik:GridBoundColumn>
    </Columns>
    </MasterTableView>
</telerik:RadGrid>
</ContentTemplate></asp:UpdatePanel>

disabling ajaxifying didn't help.

 
Ronak
Top achievements
Rank 1
 answered on 28 Aug 2012
3 answers
173 views
I created the radribbonbar programmatically using the trial dll.
But when add the bouhgt dll by the company, the code doesn't work.

for example:

this is my aspx.cs
 protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack) CreateMenu();


    }


    private void CreateMenu()
    {
        RadRibbonBar menu = new RadRibbonBar();
        menu.ID = "Menu";


        RibbonBarTab tab1 = new RibbonBarTab();
        tab1.ID = "Tab1";
        tab1.Text = "Tab1";
        RibbonBarGroup group1 = new RibbonBarGroup();
        group1.ID = "group1";
        RibbonBarButton btn = new RibbonBarButton();
        btn.ID = "btn";
        btn.Text = "btn";
        group1.Items.Add(btn);
        btn = new RibbonBarButton();
        btn.ID = "btn1";
        btn.Text = "btn1";
        group1.Items.Add(btn);
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab2";
        tab1.Text = "Tab1";
         group1 = new RibbonBarGroup();
        group1.ID = "group21";
        group1.Text = "group2";
        btn = new RibbonBarButton();
        btn.ID = "btn1";
        btn.Text = "btn1";
        group1.Items.Add(btn);
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab3";
        tab1.Text = "Tab1";
        group1 = new RibbonBarGroup();
        group1.ID = "group3";
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);


        tab1 = new RibbonBarTab();
        tab1.ID = "Tab4";
        tab1.Text = "Tab1";
        group1 = new RibbonBarGroup();
        group1.ID = "group4";
        tab1.Groups.Add(group1);
        menu.Tabs.Add(tab1);
 
        header.Controls.Add(menu);
    }


aspx:
 <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<script type="text/javascript">
//Put your JavaScript code here.
    </script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<div>
    <div id="header" runat="server">
    </div>
</div>
</form>



js error:
attach 1 and 2



How I can fix this

thanks

Ivan Zhekov
Telerik team
 answered on 28 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?