Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
209 views
This is how I formed my control

<telerik:RadBinaryImage ID="imageThumbnail" runat="server" DataValue='<%# Eval("imageThumbData") %>' ImageUrl="~/imageLibrary/common/nopic.gif" Width="125" Height="125" />

When I run the application I get an error saying

Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.


Isnt the imageURL suppose to handle this null case? How can I fix it?

Thank you.
Canis Lupus
Top achievements
Rank 1
 answered on 24 May 2011
2 answers
62 views
If you go to the online demos, each page includes various code files. In the area that the content of these files is displayed the is a link in the upper right corner which reads "Show code in new window".

Click on this link and a new window does, in fact, open. Now, go to another of the files in the original page and click on the same link.

Disappointed? I was. Instead of now having 2 windows with different files displayed in them, the new window that was opened the first time I clicked on the link had its content replaced with the 2nd file.

A quick look at the scripts suggests that a window called 'codeViewer' is always used. Can you not just use '_blank'?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 24 May 2011
3 answers
113 views
Hi,
I cannot seem to figure out how to declaratively format the result of an aggregate function using a GroupByExpression properly.
I have
GroupByExpression="Foo Name, avg(Total) [Average Days {0:0.00}]"

This shows both the formatted and unformatted value in the group header for Average Days.
Sample Result:
Name: Joe Smith; Average Days 30.47: 30.466666666666666666666666667

I can't seem to find anything online with this issue. I'm assuming I've done something wrong here.

Thanks,
ian
Radoslav
Telerik team
 answered on 24 May 2011
2 answers
63 views
Hi,

I have a requirement to set a column as GridDateTimeColumn once the data is bounded.

Which is the event which will enable me to do this. I tried in NeedDataSource[grid gets populated here] and Page_Load, but it throws an error.

Thanks,
Saravanan
saravanan k
Top achievements
Rank 1
 answered on 24 May 2011
1 answer
52 views
hi

i am getting the row index as -1 when i insert a new data i used the following
how to get the correct row or itemindex
int i = e.item.rowindex;
Pavlina
Telerik team
 answered on 24 May 2011
4 answers
729 views
Hi,

I have a site that uses custom skins and also custom base style sheets for (almost) all controls (menu, combobox, grid...) so I added these two settings to the web.config:

<add key="Telerik.EnableEmbeddedSkins" value="false" />
<add key="Telerik.EnableEmbeddedBaseStylesheet" value="false" />

this works perfectly fine... but....

now I created an additional page within the main website that uses many controls (scheduler, combobox, grid...) that should use skins & base style sheets.

so my question:
is there a possibility to override the globally set values (from the web.config) for the whole .aspx page?
so that all controls on that page will use embedded skins & base style sheets?
(btw. I cannot use a separate web.config as the whole project is one application in a cms without physical folders...)

thank you very much!
Georgi Tunev
Telerik team
 answered on 24 May 2011
3 answers
88 views
Hi

I have a table that shows the following:

Id     DivisionId     LocationId
-------------------------------------
1      4                  10
2      4                  11
3      4                  12
4      4                  13

The Division Name and Location Name are stored in seperate tables and I can resolve these name easily using linqtosql (see below how i've done this with DivisionName)

<

 

 

Columns>

 

 

<telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" UniqueName="ID">

 

</telerik:GridBoundColumn>

 

<telerik:GridBoundColumn DataField="Division.DivisionName" HeaderText="DivisionName">

 

 

</telerik:GridBoundColumn>

 

 


<
telerik:GridBoundColumn DataField="LocationID" HeaderText="LocationID">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

 


However, when you click edit/add, i need to be able to show the division names in a dropdown and the user simply selects the option (i also need to do this for location too, but i can replicate this functionality once i know how to do it)

I'm new to linqtosql and the radgrid so please bear that in mind when replying
I've looked at the linqtosql Crud opertations and i'm a little confused.
is there an edit tag, and can i put a dropdown in it and bind it to the division name
if so do you have any example code please?

I've tried using this but it doesn't work

 

 

<EditItemTemplate>

 

 

 

 

<telerik:RadComboBox DataTextField="Division.DivisionName" DataField="Division.DivisionName" ID="ddlDivisionName" runat="server" >

 

 

 

</telerik:RadComboBox>

 

 

 

 

<telerik:RadComboBox DataTextField="Location.LocationName" DataField="Location.LocationName" ID="ddlLocationName" runat="server" >

 

 

 

</telerik:RadComboBox>

 

 

 

</EditItemTemplate>

Thanks!

 

Radoslav
Telerik team
 answered on 24 May 2011
3 answers
87 views
Hi
I need to use in-line editing for the RadGrid and there is a GridDropcolumn involved also.My Grid Data source has four columns
1.CompProductId
2.ProductName
3.CompProdKeywordId
4.CompProdKeywordName

            
<telerik:RadGrid ID="radGridCompProdKeywords" GridLines="None" runat="server"
AllowAutomaticDeletes=
"True"
AllowAutomaticInserts=
"True" PageSize="10" AllowAutomaticUpdates="True" AllowPaging="false"
AutoGenerateColumns=
"False" OnUpdateCommand="radGridCompProdKeywords_ItemUpdated"
OnNeedDataSource="radGridCompProdKeywords_NeedDataSource"           
OnDeleteCommand=
"radGridCompProdKeywords_ItemDeleted"
OnInsertCommand=
"radGridCompProdKeywords_ItemInserted" Width="650px"
OnItemDataBound=
"radGridCompProdKeywords_ItemDataBound">
<MasterTableView EditMode=
"InPlace" Width="100%" CommandItemDisplay="Top" DataKeyNames=""
HorizontalAlign="NotSet" AutoGenerateColumns="False">
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType=
"ImageButton"
UniqueName=
"EditCommandColumn"> <ItemStyle CssClass="MyImageButton" />
</telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn DataField=
"CompProdKeywordId"
HeaderText="CompProdKeywordId" SortExpression="CompProdKeywordId"
 UniqueName=
"columnCompProdKeywordId" ColumnEditorID="GridTextBoxCompProdKeywordId"
Visible="false">
</telerik:GridBoundColumn>
      <telerik:GridBoundColumn DataField=
"CompProductId" HeaderText="ProductId"
SortExpression=
"ProductId" UniqueName="CompProductId"
ColumnEditorID=
"GridTextBoxCompProductId" Visible="false">
                    </telerik:GridBoundColumn>
   <telerik:GridDropDownColumn DataField=
"ProductName" HeaderText="Company Product Name"
ListTextField=
"ProductName" ListValueField="CompProductId" UniqueName="columnCompProductName"
ColumnEditorID="GridDropDownColumnCompProdName" ListDataMember="ProductName">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField=
"CompProdKeywordName"
HeaderText=
"Keyword" SortExpression="CompProdKeywordName"
 UniqueName=
"columnCompProdKeywordName" ColumnEditorID="GridTextBoxCompProdKeywordName">
                    </telerik:GridBoundColumn>
           <telerik:GridButtonColumn ConfirmText=
"Delete this product?"
ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton"
CommandName=
"Delete" Text="Delete" UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign=
"Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
               </Columns>
 </MasterTableView>
<ClientSettings>
 <ClientEvents OnRowDblClick=
"RowDblClick" />            </ClientSettings>     
 </telerik:RadGrid>

My issue is the Product Name column is not updated at all. Neither it is getting values in drop down also while doing in-line editing.
And also the Drop down is also not  showing even if I bring the data somehow in the Column.
Also if I am clicking on save, I can see that the Datasource of the Grid has value in ProductName column but while refreshing the data from the column goes away.

I have seen all the examplles of inline editing. But nothing is helping.
Could you please help me out.

Regards
Harsh


Hus Damen
Top achievements
Rank 1
 answered on 24 May 2011
1 answer
47 views

Hi,

We are trying to change the color of the filterItem when there is a filter in the grid(dynamicaly created).  It all seems to work fine but when one of the grid columns is filtered with the "Is Empty" function the color does not apply.  The code works fine and if a column is using a filterTemplate this column has the color applied correctly but the color is ignored by the other columns.

Here is the code that we use to make the filterItem change color when filter is applied :

using System;
using System.Collections;
using System.IO;
using System.Web.UI;
using CommonTools;
using Telerik.Web.UI;
namespace CCO.Fortress.MainWebApplication.Library.Helpers
{
     private void OnPageLoadComplete(object sender, EventArgs e)
        {
            FortressGrid.MasterTableView.AllowMultiColumnSorting = true;
            GridItem[] gridFilteringItems = FortressGrid.MasterTableView.GetItems(GridItemType.FilteringItem);
            if (gridFilteringItems.Length > 0)
            {      
                GridFilteringItem filteringItem = (GridFilteringItem)gridFilteringItems[0];
                foreach (GridColumn column in FortressGrid.MasterTableView.Columns)
                {
                    if (column.CurrentFilterValue != string.Empty)
                    {
                        Control control = filteringItem[column.UniqueName].Controls[0];
                        if(control is WebControl)
                        {
                            ((WebControl)control).BackColor = Color.PaleTurquoise;
                        }
                    }
                }
            }
        }
}

Thx for your help,
Guillaume

Pavel
Telerik team
 answered on 24 May 2011
3 answers
100 views
I need my scheduler to have a full 24 hour day as im using it for booking details (a band could be preforming at 1am)

eg  start time - 24:00
end time 23:59

so ive used these settings

DayStartTime="24:00:00" DayEndTime="23:59:00"   

when i run it, I get this error

Microsoft JScript runtime error: Unable to get value of the property 'cells': object is null or undefined
 on this line

l.cellWidth=l.targetRect.width/l.rows[0].cells.length;

so there seems to be a problem when creating the cells in the scheduler.  How can I set it up to use a 24 hour day ?


Stuart Hemming
Top achievements
Rank 2
 answered on 24 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?