Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
I have a aspx page with two list box, one that gets filled on page load and one that acts as the destination box.

This is working fine but now I'm looking to find a way for the user to click a button and to move any items that exist in the source listbox with a certain value and move to destination listbox.

Is there a simple of way of doing this?

I looked at looping through the items in the source listbox, but when I removed a matching item from source and added to destination the code stopped as the collection had changed.
Genady Sergeev
Telerik team
 answered on 28 May 2010
1 answer
124 views
How do I add new row to my details from client side..without postback. My grid is displayed in hriearchy mode and has two details view and one master view. I want to add new row to my second detail view. Dont want to add row to datasource and rebind the grid as my grid is having huge data and it takes time to rebind the grid.

Here is the scenario..when user right clicks on first detail view..context menu is displayed which has item for inserting new row to the second detail view table. When user clicks on this menu item i.e. Add new then a new row should be added to second detail view without postback.

grid structure as below:

Master view
    >> first details view1
   >>>> second details view.1
   >>>> second details view.2
   >>first details view2
   >>>> second details view.1
   >>>> second details view.2
   >>>> second details view.3
Also in the similar way I want to delete the row.

Please let me know how this can be achieved.
Daniel
Telerik team
 answered on 28 May 2010
1 answer
151 views
Hi,

           I am using Silverlight MultiFile Upload Control For uploading multiple files and also using radupload when silverlight is not install on machine so how i can work both of these and in c# how i can save the file if these both are diffrent.

<

telerik:RadAjaxPanel runat="server" ID="AjaxPanelMain" LoadingPanelID="LoadingExamplePanel" EnableAJAX ="true">

 

 

<asp:Panel runat="server" ID="Panel1" Visible="true">

 

 

<input type="hidden" id="UploadedFilesJson" runat="server" />

 

 

<div class="upload-panel">

 

 

<div class="upload">

 

 

<object id="SilverlightUpload" data="data:application/x-silverlight," type="application/x-silverlight-2"

 

 

width="400px" height="120px">

 

 

<param name="source" value='<%= ResolveUrl("~/Upload.xap") %>' />

 

 

<param name="background" value="white" />

 

 

<param name="minRuntimeVersion" value="2.0.31005.0" />

 

 

<param name="autoUpgrade" value="true" />

 

 

<param name="windowless" value="true" />

 

 

<param name="InitParams" value='<%= InitParameters %>' />

 

 

<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">

 

 

<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"

 

 

style="border-style: none" />

 

 

</a>

 

 

<telerik:RadUpload ID="radUpload" ControlObjectsVisibility="All"

 

 

AllowedFileExtensions=".stl,.zip"

 

 

MaxFileSize="80000000"

 

 

runat="server" InitialFileInputsCount="5">

 

 

</telerik:RadUpload>

 

 

 

 

 

</object>

 

 

<div class="uploaded-files" >

 

 

</div>

 

 

 

 

 

</div>

 

 

 

</div>

 

 

</asp:Panel>

 

 

 

 

 

 

</telerik:RadAjaxPanel>



this code is giving me a javascript error, So please help me ho i can save the file in a folder.If i am using foreach loop than how i will use silverlight control for same.

 

foreach (Telerik.Web.UI.UploadedFile file in radUpload.UploadedFiles)

 

 

 


 

int position = file.FileName.LastIndexOf("\\");

 

 

 

 

 string fileName = (position == 0 ? file.FileName.Substring(position) : file.FileName.Substring(position + 1));

 

 

 

 

 

 string filePath = Server.MapPath(m_path + "/" + orderIdPath + fileName);

 

 

 file.SaveAs(filePath);

 

 


}


Please Help me out this problem.

thanks,

Genady Sergeev
Telerik team
 answered on 28 May 2010
1 answer
104 views
i am using a custom appointment form. all works well when i insert a new event. however, if i try to modify an event, i am not able to obtain the time from the control. it puts it at 12:00:00.

 

<telerik:radscheduler id="RadScheduler1" runat="server" Skin="WebBlue" Height="460px"

 

 

OnAppointmentDelete="RadScheduler1_AppointmentDelete" StartEditingInAdvancedForm="false" OnAppointmentCreated="RadScheduler1_AppointmentCreated"

 

 

OnClientAppointmentInserting="AppointmentInserting" OnClientAppointmentEditing="AppointmentEditing">

 

 

<AppointmentTemplate>

 

 

<asp:Label runat="server" ID="lblEventName" />

 

 

</AppointmentTemplate>

 

 

 

</telerik:radscheduler>

 


It is this line of code that causes the problem:

startDateString =

"#" & Format(StartDate.SelectedDate, "MM/dd/yyyy")

 

startTimeString = StartTime.SelectedDate.Value.ToShortTimeString &

"#"

 

CalendarEventBE.EventStartTime =

CDate(startDateString & " " & startTimeString)

As an example, I inserted an appointment then tried to change the date from 6/1 4:45pm to 6:15pm to: 6/3 5:00pm to 7:00pm. I changed the information on my screen and clicked 'Update'. Here are the values of the above:

startDateString = "#06/03/2010"
startTimeString = "12:00 AM#"  HERE IS THE PROBLEM. Why is this not returning my time??? It works fine on the insert.

Thanks and let me know if you need additional information.

Susan

 

Peter
Telerik team
 answered on 28 May 2010
7 answers
102 views
I would like to create a page in the fashion of your demo shown in http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=binaryimage

I have made a slight change, and do not know how to adjust the VB code to compensate for it.

I have changed the code below from : 
 <telerik:GridBinaryImageColumn DataField="Data" HeaderText="Image" UniqueName="Upload" ImageAlign="NotSet"
                        ImageHeight="80px" ImageWidth="80px" ResizeMode="Fit" DataAlternateTextField="Description"
                        DataAlternateTextFormatString="Image of {0}">
                        <HeaderStyle Width="10%" />
                    </telerik:GridBinaryImageColumn>


to the following code:

<

 

telerik:GridTemplateColumn >

 

 

<ItemTemplate>

 

 

<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" DataValue = '<%# Eval("Document") %>' ResizeMode = "Fit" Height="150px" Width="150px" />

 

 

<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="radBinaryImage1" Position="Center">

 

 

<telerik:RadBinaryImage ID="RadBinaryImage2" runat="server" DataValue = '<%# Eval("Document") %>' ResizeMode = "Fit" Height="800px" Width="600px" />

 

 

 

</telerik:RadToolTip>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 



The problem I am having is with the VB code below that is in bold and Italics. How do I change this code to work with the GridTemplateColumn, instead of the Gridbinaryimagecolumn?



Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
                Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)


                Dim upload As RadUpload = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor).RadUploadControl


                RadAjaxPanel1.ResponseScripts.Add(String.Format("window['UploadId'] = '{0}';", upload.ClientID))
            End If
        End Sub

        Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
                Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)


                Dim upload As RadUpload = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor).RadUploadControl


                Dim validator As CustomValidator = New CustomValidator()
                validator.ErrorMessage = "Please select file to be uploaded"
                validator.ClientValidationFunction = "validateRadUpload"
                validator.Display = ValidatorDisplay.Dynamic
                DirectCast(upload.Parent, TableCell).Controls.Add(validator)
            End If
        End Sub

     

Genady Sergeev
Telerik team
 answered on 28 May 2010
6 answers
188 views
Hi folks,

I need some CSS help within the grid's CommandItemTemplate. I'm trying to center some title text in the command bar while right-aligning a couple of linkbuttons.

Up til now, I've been using margin spacing to achieve this. It's a trial and error thing, adding the number of pixels to make the heading text ("Contact Events") appear centered.
 
The attached graphic shows roughly what I'm trying to achieve. The following code is what I have now. It's getting difficult to maintain as I add more screens to the app:

<CommandItemTemplate> 
    <span style="margin-right: 280px; font-size: 21px; vertical-align: bottom; font-weight: bold;">  
        Contact Events</span> 
    <asp:LinkButton CssClass="rgCommandButton" ID="btnResetCommand" runat="server" Text="Reset Filters" 
        ToolTip="Removes all filters" /> 
    <asp:LinkButton CssClass="rgCommandButton" ID="btnAddCommand" runat="server" Text="New Event" 
        ToolTip="Adds an Event" /> 
</CommandItemTemplate> 

Is there a way to automatically center "Contact Events" while keeping the two link buttons right-aligned?

Thanks for any guidance!

Ken
Microsoft MVP [ASP.NET]
kencox
Top achievements
Rank 1
 answered on 28 May 2010
7 answers
337 views
Hello,

I've got an RadGrid with inline edit mode. I put a GridNumericColumnEditor in the markup and associated it with a column(ColumnEditorID attribute) .
The first time I click "edit", the editor is applied to the column. If I click "cancel" and then click "edit" again, everything goes well.
But, if I try to "edit" a row while already have one in edit mode, the editor is not applied. If I put a watch on it, it's empty.

I put on the same page a "GridDateTimeColumnEditor" and everything works with this one.

here's my code

<telerik:GridNumericColumnEditor ID="quantityColumnEditor" runat="server"
        <NumericTextBox runat="server" ID="xxx" Width="50px" ShowSpinButtons="true" MaxValue="999" 
            MinValue="1"
            <IncrementSettings Step="1" /> 
        </NumericTextBox> 
    </telerik:GridNumericColumnEditor> 
    <telerik:GridDateTimeColumnEditor ID="deliveryDateColumnEditor" runat="server"
        <TextBoxStyle Width="92px" /> 
    </telerik:GridDateTimeColumnEditor> 

 <telerik:GridNumericColumn ColumnEditorID="quantityColumnEditor" FilterControlWidth="50px" 
                    ConvertEmptyStringToNull="true" HeaderText="QUANTITY" DataType="System.Int32" 
                    DataField="QUANTITY" UniqueName="quantity"
                    <HeaderStyle Width="80px" Wrap="false" CssClass="rgHeader xxFCcol6" /> 
</telerik:GridNumericColumn> 
 <telerik:GridDateTimeColumn ColumnEditorID="deliveryDateColumnEditor" HeaderText="DATE OF REQUEST" 
                    DataField="REQUESTDATE" DataType="System.Datetime" EmptyDataText="n/a" ConvertEmptyStringToNull="true" 
                    UniqueName="requestdate" DataFormatString="{0:d}"
                    <HeaderStyle Width="100px" CssClass="rgHeader xxFCcol3" /> 
</telerik:GridDateTimeColumn> 


Any Idea?

Martin
Telerik team
 answered on 28 May 2010
1 answer
136 views
I have a RadGrid that is not displaying the header row correctly.  The right column of the RadGrid has got some odd formatting.  I have attached a document (.png) that illustrates the issue.

Here is sample code the pages:

This page is not working:
<telerik:RadGrid ID="grdMasterList" Visible="true" runat="server" EnableEmbeddedSkins="false" 
                            Skin="Premise" AllowPaging="false" AllowMultiRowSelection="false" AutoGenerateColumns="false" 
                            PageSize="25" AllowSorting="true" OnItemDataBound="grdMasterList_ItemDataBound" 
                            OnItemCreated="grdMasterList_ItemCreated" Height="100%">  
                            <ClientSettings EnableRowHoverStyle="true">  
                                <Selecting AllowRowSelect="true" /> 
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                                <ClientEvents OnGridCreated="GridHeight" /> 
                            </ClientSettings> 
                            <MasterTableView Name="CodeTable" HierarchyLoadMode="ServerOnDemand" DataKeyNames="PersNbr" 
                                ClientDataKeyNames="ChkInOutStatus, PersNbr, DeviceNbr, CurrBreakStatCd, BreakNbr" TableLayout="Fixed">  
 

This page is working:
<telerik:RadGrid ID="grdMasterList_ZoneCoverage" runat="server" EnableEmbeddedSkins="false" 
                                        Skin="Premise" AllowPaging="false" AllowMultiRowSelection="false" AutoGenerateColumns="false" 
                                        PageSize="25" AllowSorting="true" OnItemCreated="grdMasterList_ZoneCoverage_ItemCreated" 
                                        OnItemDataBound="grdMasterList_ZoneCoverage_ItemDataBound" OnPreRender="grdMasterList_ZoneCoverage_PreRender" 
                                        Height="600">  
                                        <ClientSettings EnableRowHoverStyle="false">  
                                            <Selecting AllowRowSelect="true" /> 
                                            <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                                            <ClientEvents OnGridCreated="GridHeight" /> 
 

</ClientSettings>

                                        <MasterTableView Name="CodeTable" HierarchyLoadMode="ServerOnDemand" DataKeyNames="OrgNbr" TableLayout="Fixed">


I have tried turning TableLayout Auto and Fixed.  But that had no effect.

Any thoughts?

Thanks.

Steve


Dimo
Telerik team
 answered on 28 May 2010
4 answers
266 views

Hi,

I am using Radtabstrip in a header control which I have placed in my master page. I'm trying to redirect to the specific pages on cliking of tabs in header, which is working fine. The only problem is, the selected tab of Radtabstrip is always the first tab. It is redirecting to correct page but focus is always to tab 0 in Radtabstrip. Following is my html code.

<

 

telerik:RadTabStrip ID="RadTabStrip1" runat="server" 

 

 

 

SelectedIndex="0" CssClass="tabStrip" OnTabClick="RadTabStrip1_TabClick" CausesValidation="false">

 

 

<Tabs>

 

 

<telerik:RadTab Text="Home">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Login">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Register">

 

 

</telerik:RadTab>

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

 

 


Below is my code behind

protected

 

void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)

 

 

{

 

 

string  HTMLTemplatePath =

ConfigurationSettings.AppSettings["Path"]; 

 

 

string strCurrentTab = e.Tab.Text;

 

 

switch (strCurrentTab)

{

 

 

 

case "Home":

 

RadTabStrip1.SelectedIndex=e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Home);

 

 

 

 

break;

 

 

 

 

case "Login":

 

RadTabStrip1.SelectedIndex = e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Login);
break;

 

 

 

case "Register":

 

RadTabStrip1.SelectedIndex = e.Tab.Index;

 

Response.Redirect(HTMLTemplatePath +

 

GeneralDeclaration.PAGE_Register); 

 

 

 

break;

 

}

}



Thanks.

 

 

Andrew Cao
Top achievements
Rank 1
 answered on 28 May 2010
6 answers
404 views
Is this possible to export Japanese text?
I tried this in demo site. It was converted into ###  characters.  http://demos.telerik.com/aspnet-ajax/editor/examples/pdfexport/defaultcs.aspx

Rumen
Telerik team
 answered on 28 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?