Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
237 views
The subject says it all :) I have a GridBinaryImageColumn in a RadGrid as:
<telerik:GridBinaryImageColumn
    DataAlternateTextField="Title"
    DataField="BinaryContent"
    HeaderText="Image"
    ImageAlign="NotSet"
    ImageHeight="120px"
    ImageWidth="120px"
    ResizeMode="Fit"
    UniqueName="BinaryContent">
</telerik:GridBinaryImageColumn>

I'm using code-behind and Entity Framework and want to take the binary content of the selected file and set that to the appropriate entity property (which is of course byte[]).

How? All the samples I can find are declarative or not quite what I want. Here's an example of where I'd like to place such functionality:

protected void SetValues(GridCommandEventArgs e)
{
    if (e == null)
    {
        return;
    }
 
    if (!(e.Item is GridEditableItem))
    {
        return;
    }
 
    var editedItem = e.Item as GridEditableItem;
 
    var hashTable = new Hashtable();
 
    e.Item.OwnerTableView.ExtractValuesFromItem(hashTable, editedItem);
 
    // Simpler form of access naturally won't work.
    if (hashTable.ContainsKey("BinaryContent"))
    {
        // I KNOW I can't access the content like this:
        //  this.EntityBinaryContent = hashTable["BinaryContent"] == null
        //     ? null
        //     : SomeUtility.ConvertToBytes(hashTable["BinaryContent"]);
 
        // But at this stage, with what I have to work with (e) etc.
        // How can I easily get hold of the upload bytes?
    }
}

Edit: Should mention the intention is that the binary data goes into the database and the file is never saved to a file system. So, I can't work with an uploaded file as there won't be one.

Many thanks,
Richard
Richard Weeks
Top achievements
Rank 2
 answered on 24 Apr 2012
1 answer
121 views
I have a page that uses three RadMenus—one is horizontal and two vertical. I need to use a different properties on the horizontal menu than on the vertical ones. What is the simplest way to accomplish this?

Thanks!
John
Princy
Top achievements
Rank 2
 answered on 24 Apr 2012
1 answer
542 views
i want to change date format ( mm/dd/yyyy to dd/mm/yyyy) at Scheduler control.

e.g
http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx

at scheduler control, month view, when i point today (20) then pop up 4/20/2012
i want to change 20/4/2012
Plamen
Telerik team
 answered on 24 Apr 2012
11 answers
768 views
Hi,
I've have to radgrid binded from List in asp.net.
Each row in radgrid has action column, ImageButton which has VIEW|EDIT|DELETE
when Edit is clicked radwindow should display selected row details in popup and save button just displays modified row text on the radgrid back

Thanks
Krishna
Princy
Top achievements
Rank 2
 answered on 24 Apr 2012
2 answers
86 views
Can't get to the forums using Chrome. Had to use IE9 to post this thread!
Jeremy
Top achievements
Rank 1
 answered on 24 Apr 2012
2 answers
321 views

I have a rad menu with several items.  The menu items lead to different places depending on a few things, so i'm trying to implement an OnClick handler in the code behind to redirect appropriately.  I've tried all kinds of combinations and scoured the forums and nothing has worked so far.  

   My OnClick method is just a stub right now with a breakpoint so I can see when it gets called, only it isn't getting called, and I'm redirected to the default.aspx page. 

Ths is within a user control, if that matters.  Are you aware of anything that could cause this behavior? 

protected void RadMenu_ItemClick(object sender, RadMenuEventArgs e)
        {
            int i = 0;
            String s = e.Item.Value;
        }

<radM:RadMenu ID="RadMenu" runat="server"  OnItemClick="RadMenu_ItemClick" >
    <Items>
         <radM:RadMenuItem runat="server" ID="sampleItem" Text="Click Me" />
    </Items>
</radM:RadMenu>
Phil
Top achievements
Rank 2
 answered on 24 Apr 2012
2 answers
114 views
I have a link that looks like;

<a href="javascript:;" onclick="xlaAFMopenfaq(1);" class="HeaderLink">Customer Service</a>


How do I add it to a NavigateURL in a menu item?
Phil
Top achievements
Rank 2
 answered on 24 Apr 2012
1 answer
113 views
When i enable grid view state unable to see any size reduction on the Fiddler when the browser posts back the Data in Ajax panel (Sent Bytes) are the same.
We have 300 rows and 16 columns on the Grid and so its a,lot of Data. But why my Page size has not reduced on doing a  Grid Sort (ajax).
Richard
Top achievements
Rank 1
 answered on 23 Apr 2012
1 answer
107 views
How Can I do to write a datetime to the XAxis? And how to attach to the Xaxis the value of my variable? 
Richard
Top achievements
Rank 1
 answered on 23 Apr 2012
3 answers
284 views
I have a RadGrid. I want to make it UI accessible. In this grid I am using checkboxes for row selection like this:

   
<telerik:GridClientSelectColumn UniqueName="headerSelectAll" ItemStyle-Width="40px"
ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="40px" HeaderStyle-HorizontalAlign="Center"  />          


 
Each checkbox is clickable and I want that it will be 508 UI Accessible. Please suggest for it.

Thanks.
Martin
Telerik team
 answered on 23 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?