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

I am using RadEditor for ASP.Net AJAX.  i have created custom EditorSplitButton with dropdownitems.

if i click one dropdownitem, it will fire the event correctly. after that the selected item wont be reset.how can i do that in javascript.

// Design
 <telerik:RadEditor runat="server" ID="RadEditor1" Skin="Sunset" EditModes="Design" OnClientCommandExecuting="OnClientCommandExecuting">
 <Tools>
 <telerik:EditorToolGroup>
<telerik:EditorSplitButton Name="FontSize" Text="Size" ItemsPerRow="1" ShowText="true"  Width="200px">
<telerik:EditorDropDownItem Name="Smallest"   Value="1"/>
<telerik:EditorDropDownItem Name="Smaller"   Value="2"/>
</telerik:EditorSplitButton>
</telerik:EditorToolGroup>
</Tools>
</telerik:RadEditor>

//Javascript

function OnClientCommandExecuting(editor, args)
            {
              if (name == "FontSize")
                {
                    var tool = args.get_tool();
                    var span = tool.get_element().getElementsByTagName("SPAN")[0];
                    span.style.backgroundImage = "url(" + val + ")";
                     editor.pasteHtml('[SIZE="' + val + '"]' + editor.getSelectionHtml() + '[/SIZE]');
                    args.set_cancel(true);
                    editor.getSelectedElement() = val;
                }

My question is initially the tool looks like , FontSize- within the dropdown Smallest,Smaller will come.
if i select Smaller, it fires the event and selected item is on the top.

but i want to reset the tool, so that Font Size will come on the top.

How to do that?

Please reply me early,

Thanks,
Mano.
Rumen
Telerik team
 answered on 02 Feb 2010
1 answer
90 views
Im a little confused as to what approach to take here.  I have a grid whos MastTableView uses bound columns and allowing auto edit/insert.  The datasource is an entity datasource (which uses a SQL Server View).  However, my edit/insert form obviously comes from a different datasource, and, multiple datasources at that.

Grid
   details > datasource1
   edit/insert form> datasource2
       listbox > datasource3
 
Should I connect the OnEditCommand for the grid and change its datasource accordingly?  I'm fine with doing this programmaticly, but not sure what approach to take.  Any good demos on this would be great or support articles.
Yavor
Telerik team
 answered on 02 Feb 2010
3 answers
139 views
Hi, 

 I am trying to use the gridbinary image in radgridview using linq. But its not displaying.
It works fine with the sql datasource but when i use linq no image is displayed.

Can any one suggest me how to write the code using linq for displaying the  image in radgridview

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">

 

 

 

<telerik:RadProgressManager ID="RadProgressManager1" runat="server" />

 

 

 

<telerik:RadProgressArea ID="RadProgressArea1" runat="server" />

 

 

 

<telerik:RadGrid runat="server" ID="RadGrid1" onneeddatasource="RadGrid1_NeedDataSource" AllowPaging="True" AllowSorting="True"

 

 

 

AutoGenerateColumns="False" Width="97%" AllowAutomaticInserts="true"

 

 

 

AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" ShowStatusBar="True"

 

 

 

GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated" PageSize="3">

 

 

 

<PagerStyle Mode="NumericPages" AlwaysVisible="true" />

 

 

 

<MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ImageID" >

 

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton">

 

 

 

<HeaderStyle Width="3%" />

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="ImageName" UniqueName="ImageName" SortExpression="ImageName">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label runat="server" ID="lblName" Text='<%# Eval("ImageTitle") %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadTextBox runat="server" Width="200px" ID="txbImageTitle" Text='<%# Bind("ImageTitle") %>' />

 

<

 

 

asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbImageTitle"

 

 

ErrorMessage

 

="Please, enter a ImageTitle!" Display="Dynamic" SetFocusOnError="true" />

 

 

 

</EditItemTemplate>

 

 

 

<HeaderStyle Width="30%" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="ImageDescription" UniqueName="ImageDescription" DataField="ImageDescription">

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="lblDescription" runat="server" Text='<%# TrimDescription(Eval("ImageDescription") as string) %>' />

 

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

 

<telerik:RadTextBox ID="txbDescription" Width="300px" runat="server" TextMode="MultiLine"

 

 

 

Text='<%# Bind("ImageDescription") %>' Height="150px" />

 

 

 

</EditItemTemplate>

 

 

 

<ItemStyle VerticalAlign="Top" />

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

 

 

 

 

<telerik:GridBinaryImageColumn DataField="ImageFile" HeaderText="Image" UniqueName="Upload" ImageAlign="NotSet"

 

 

 

ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit" DataAlternateTextField="ImageDescription"

 

 

 

DataAlternateTextFormatString="Image of {0}" >

 

 

 

<HeaderStyle Width="10%" />

 

 

 

 

</telerik:GridBinaryImageColumn>

 

 

 

 

<telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton">

 

 

 

<HeaderStyle Width="2%" />

 

 

 

</telerik:GridButtonColumn>

 

 

 

</Columns>

 

 

 

<EditFormSettings>

 

 

 

<EditColumn ButtonType="ImageButton" />

 

 

 

</EditFormSettings>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

</telerik:RadAjaxPanel>


.cs file

 

 

public void BindGrid()

 

{

 

 

 

// RadGrid1.DataSource = PR.ListAllImages();

 

 

 

 

 

 

 

int ImagTemp = Convert.ToInt32(Request.QueryString["TemplateID"]);

 

 

 

// RadGrid1.DataSource = PR.GetImageGalleryDetailByTemplateID(ImagTemp);

 

 

 

 

 

RadGrid1.MasterTableView.DataSource = PR.GetImageGalleryDetailByTemplateID(ImagTemp);

 

}

 

 

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

BindGrid();

 

}

 

 

 

//code added for edit update and delete data

 

 

 

 

 

 

 

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

 

if (e.Item is GridEditableItem && e.Item.IsInEditMode)

 

{

 

 

GridBinaryImageColumnEditor editor = ((GridEditableItem)e.Item).EditManager.GetColumnEditor("Upload") as GridBinaryImageColumnEditor;

 

RadAjaxPanel1.ResponseScripts.Add(

 

string.Format("window['UploadId'] = '{0}';", editor.RadUploadControl.ClientID ));

 

}

}

 

 

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)

 

{

 

 

if (e.Item is GridEditableItem && e.Item.IsInEditMode)

 

{

 

 

GridBinaryImageColumnEditor editor = ((GridEditableItem)e.Item).EditManager.GetColumnEditor("Upload") as GridBinaryImageColumnEditor;

 

 

 

TableCell cell = (TableCell)editor.RadUploadControl.Parent;

 

 

 

CustomValidator validator = new CustomValidator();

 

validator.ErrorMessage =

 

"Please select file to be uploaded";

 

validator.ClientValidationFunction =

 

"validateRadUpload";

 

validator.Display =

 

ValidatorDisplay.Dynamic;

 

cell.Controls.Add(validator);

}

}

 

 

 

protected string TrimDescription(string description)

 

{

 

 

if (!string.IsNullOrEmpty(description) && description.Length > 200)

 

{

 

 

return string.Concat(description.Substring(0, 200), "...");

 

}

 

 

return description;

 

}

 

 

// end of code

 

 

 

Rosen
Telerik team
 answered on 02 Feb 2010
3 answers
120 views
hi,
i need help regarding the default focus in rad alert.

i am having the default focus for the page gets loaded.

when the page is firing the rad alert, after clicking "OK" button in rad alert the focus is lost.

i need solution fort he above problem


ThanQ,
Vara Prasad.M
prasad
Top achievements
Rank 2
 answered on 02 Feb 2010
1 answer
179 views
Hello,

Is it possible to change the Language of the scheduler to german?
Shinu
Top achievements
Rank 2
 answered on 02 Feb 2010
1 answer
137 views
Hello everyone,

I have a simple databound pie chart that I display in a very limited space.  I was hoping I can display the legend for the chart in a tooltip, hovering over the chart will display the tooltip showing the legend for the chart.  Can anyone please point me in the direction to achieve this?

Thanks
Matt
Vladimir Milev
Telerik team
 answered on 02 Feb 2010
1 answer
119 views
Using RadEditorSharePoint 5.6.1.0 (MOSS 2007), when we try to open the hyperlink manager in the radeditor to link to a different page then NO PAGES APPEAR in the pages library of the current site (although pages exists and published).

please advise.
Stanimir
Telerik team
 answered on 02 Feb 2010
4 answers
185 views
Hi, I have a radgrid which has radio buttons on the commanditemtemplate.
There are two issues with it.
1. On the pageload I cannot get the control by its name but I have to use document.getElementById with the client id. Don't know why.
2. Bigger issue is that the selection made on the radio buttons do not stick after postback.
If I move thse controls outside the grid, everything works fine though.

Appreciate your help.

Thanks,
Anil



<telerik:RadCodeBlock runat="server" ID="radCodeBlock">  
        <script type="text/javascript">  
            function pageLoad(sender, args) {  
                var radShowYes = document.getElementById('ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl02_ctl00_radShowHideYes');  
                if (radShowYes.checked)  
                    $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();  
                else  
                    $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();  
            }  
            function showFilterItem(){  
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();  
            }   
            function hideFilterItem(){  
                $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();  
            }  
</script> 
</telerik:RadCodeBlock> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" Width="96%" GridLines="None" Skin="Vista">  
...  
 
<MasterTableView DataKeyNames="ReferralID" Width="100%"   
            CommandItemDisplay="Top" AllowFilteringByColumn="true"   
            AllowMultiColumnSorting="false" AlternatingItemStyle-BackColor="Beige">  
            <CommandItemTemplate> 
                <div style="padding: 5px 5px;">  
                &nbsp;&nbsp;&nbsp;&nbsp;  
                    <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert" CausesValidation="false">  
                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/AddRecord.gif" />Add new Record  
                    </asp:LinkButton> 
                   
 
Show filters <input id="radShowHideYes" type="radio" runat="server" name="showHideGroup" onclick="showFilterItem()" /> 
                    <label for="radShowHideYes">Yes</label>   
                    <input id="radShowHideNo" type="radio" runat="server" name="showHideGroup" checked="true" onclick="hideFilterItem()"/>  
                    <label for="radShowHideNo">No</label>      
                    Clear filters  
                    <asp:ImageButton ID="btnShowAll" runat="server" ImageUrl="~/Images/CancelSmall.gif" OnClick="btnShowAll_Click" 
                        Style="vertical-align: middle" /> 
                </div> 
            </CommandItemTemplate> 
.......  

<

 

ClientSettings>

 

 

<Scrolling AllowScroll="false" />

 

 

<ClientEvents OnFilterMenuShowing="filterMenuShowing" />

 

 

</ClientSettings>

 

 

<FilterMenu OnClientShown="MenuShowing" />

 

 
 
 
Shinu
Top achievements
Rank 2
 answered on 02 Feb 2010
1 answer
202 views
Is it possible to position the popup buttons to be under the DateInput box?
Shinu
Top achievements
Rank 2
 answered on 02 Feb 2010
15 answers
264 views
Hey Everyone,

I have a radgrid that is very wide - 50 or so columns.  The majority of the columns have filtering enabled.   If I enter filter criteria that results in no rows the grid gets cut off. I am unable to scroll over to see a good portion of the grid.  If the column I'm trying to filter on is one of the columns that gets cut off I'm unable to re-filter on that column.  I tried upgrading to the latest version of Telerik but the problem persisted.   Has anyone seen this behavior?

Thanks,
Larry
Yavor
Telerik team
 answered on 02 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?