Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
197 views
Hi,

I want to open a radWindow when i click the "Add New Row" Button. I know, i could use a Hyperlink (custom commanditem) - this would be an option if i could use the default style of the Insert Button.

I already stopped the default Insert Event with this code.
protected void gvUser_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        e.Canceled = true;
           ... some code ...
    }
}

In the ItemCreaded Event I tried to add a "onclick" event, but this wont work.
protected void gvUser_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
 {
     if (e.Item is GridCommandItem)
     {
         LinkButton addButton = e.Item.FindControl("InitInsertButton") as LinkButton;
         addButton.Attributes["onclick"] = "return ShowInsertForm();";
     }
}

This is my javascript function.
function ShowInsertForm() {
    window.radopen("Bearbeiten.aspx?umleitung=-1", "rwBearbeiten");
    return false;
}

And this is my radWindowManager
<telerik:RadWindowManager ID="rwmBearbeiten" runat="server" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="rwBearbeiten" runat="server" ShowContentDuringLoad="false"
            Width="800px" Height="650px" Title="Bearbeite Umleitungsdaten" Behaviors="Default"
            Modal="true" ReloadOnShow="true">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I dont have another idea, how i can solve this - i really want to keep the default style of the commanditem - it looks really great.


Best regards,
Raimund
ming
Top achievements
Rank 1
 answered on 18 Aug 2011
1 answer
107 views
Hi, I'm very newbie to this telerik component. I've downloaded the trial products, but I got a problem with mega drop down menu that I tried to create. I've been following the demo isolation steps but got a little confusing with the scenario. If someone could help me with project attachment, it would probably help me so much. Thank you very much.

Demo :

http://demos.telerik.com/aspnet-ajax/menu/examples/megadropdown/defaultvb.aspx
Kate
Telerik team
 answered on 18 Aug 2011
3 answers
99 views
Hi,

I am using this server side sample code to prevent appointments from overlapping:

http://demos.telerik.com/aspnet-ajax/scheduler/examples/limitconcurrentappointments/defaultcs.aspx

The problem I am trying to solve is this. If an operation is cancelled using the code above, the advanced edit form redisplays as expected but contains no data. In addition, the Save and Cancel buttons have no text in them, and the title bar of the window is also blank. It's possible to re-enter the data into the blank controls, and save the changes by clicking the blank Save button, but clearly this isn't a situation acceptable to a user.

The control is being hosted in a Sharepoint Visual Web Part, and I have taken measures in the hosting web part to ensure that the ScriptManager provided by Sharepoint is replaced by the RadScriptManager. The FormsCreated event is fired when the form is first shown, but does not execute again for the redisplay of the form following the event cancellation by the server side code.

Has anyone encountered this issue. My suspicion was the Sharepoint ScriptManager, but now that I'm ensuring that the RadScriptManager is in its place have run out of ideas.

Your help is appreciated!
Kalina
Telerik team
 answered on 18 Aug 2011
2 answers
67 views
Hello,

After running my project i am getting Error. (Attached the error screenshot).
after that if i do refresh then it works.

But 1st time after running project it gives that error.

What to do?
Mugdha Aditya
Top achievements
Rank 1
 answered on 18 Aug 2011
1 answer
174 views
I have radgrid on click of add new record, my radwindow opens up with loading image in green color but i want that to be changed to blue color, and my radwindow skin should remain black only.

This is my code where i am setting the property for radwindow
 <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
                        Skin="Black" >
                        <Windows>
                            <telerik:RadWindow ID="UserListDialog" runat="server" Height="620px" Width="620px"
                                ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false" Animation="Resize"  AutoSize="false" Behaviors="Close"/>
                        </Windows>
                    </telerik:RadWindowManager>
Shinu
Top achievements
Rank 2
 answered on 18 Aug 2011
3 answers
177 views

Hi Folks,

first of all, I'm new to Telerik controls. I'm using a RadGrid to display some data, which contains a DropDown column. The grid is bound to a data table on the page load event. Source of this is a SQL server. Here some Code of my binding:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
 Dim table_competitor_work As DataTable = getSQLData("SELECT competitor, value, units FROM competitor_work")
 RadGrid1.DataSource = table_competitor_work
 RadGrid1.DataBind()
End Sub
 
Protected Function getSQLData(ByVal query As String) As DataTable
   Dim connString As String = "Data Source=home-sps2010\POWERPIVOT;Initial Catalog=marketsurvey;Integrated Security=SSPI;"
   Dim conn As New SqlConnection(connString)
   Dim cmd As SqlCommand = New SqlCommand(query, conn)
   conn.Open()
 
   Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
 
   Dim dt As New DataTable
   dt.Load(dr)
   conn.Close()
 
   Return dt
End Function


And here is my markup code:

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
                    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0"
                    GridLines="Horizontal" Skin="Telerik" AllowAutomaticDeletes="True"
                    AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
                    <MasterTableView CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add new customer">
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridDropDownColumn EmptyListItemText="Empty"
                                EmptyListItemValue="Empty" FilterControlAltText="Filter Customer column"
                                HeaderText="Competitor" UniqueName="Competitor" DataField="competitor">
                            </telerik:GridDropDownColumn>
                            <telerik:GridNumericColumn DecimalDigits="2"
                                FilterControlAltText="Filter Value column" HeaderText="Value 2010"
                                UniqueName="Value" DataField="value">
                            </telerik:GridNumericColumn>
                            <telerik:GridNumericColumn DecimalDigits="0"
                                FilterControlAltText="Filter Units column" HeaderText="Units 2010"
                                UniqueName="Units" DataField="units">
                            </telerik:GridNumericColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                </telerik:RadGrid>


The strange thing is, the binding an everything works not on the dropdown column. Nothing is displayed and I don't now why. I wanted to bind the dropdown column to a sql datasource and in the insert and edit forms I wanted to diplay other data for the dropdown list. I thought I can do it that way:

DataField="SQLserverField" (bound in code behind at runtime)
DataSourceID="SQLDataSource" (same database, but other table)
ListTextField="SQLDataSourceField"
ListValueField="SQLDataSourceField"

But that isn't working so well. Still there are no value displayed in the grid. But On insert and edit the right values are there.

Do you have an idea?

Thanks and regards,
Mark

Mark Ferkaluk
Top achievements
Rank 1
 answered on 18 Aug 2011
1 answer
108 views
Is there any workaround for setting GroupBy columns on initial page load? I don't want users to be able to change the grouping, I just want it to group by one or more columns when bound to a SharePoint list.
Iana Tsolova
Telerik team
 answered on 18 Aug 2011
4 answers
158 views
Hi,

My requirement is to user Radasynchuploader with .Net framework 3.5 and Telerik version Telerik.Web.UI - 2011.2.712.35.
Multifileupload doesn't work if we don't have flash/silverlight installed in the users machine.
We have customers who cannot install this. So is there a way to get Radasynchuploader with the above versions and still be able to select mutiplefiles.
I  could see in one of the post that 'FileApi' module helps in multi file upload with the above version of Telerik. If there is no flash and silverlight in the end users machine it should automatically use the FileApi module right? But why doesn't multi file upload still work for me?

Is there any limitations for Radasynchuploader with the above versions?
Helen
Telerik team
 answered on 18 Aug 2011
5 answers
276 views
I have two RadDateTimePickers inside a RadGrid's <EditItemTemplate /> which represents a start/end date as such:
<tr>
    <td><p><strong>Start Date: </strong></p></td>
    <td>
        <telerik:RadDateTimePicker runat="server" ID="rdtpStartDate" Skin="Windows7" DbSelectedDate='<%#Bind("StartDate") %>' ClientEvents-OnDateSelected="dateSelected" />
        <asp:RequiredFieldValidator runat="server" Display="None" ErrorMessage="Start Date is required." EnableClientScript="true" ControlToValidate="rdtpStartDate" />
    </td>
</tr>
<tr>
    <td><p><strong>End Date: </strong></p></td>
    <td>
        <telerik:RadDateTimePicker runat="server" ID="rdtpEndDate" Skin="Windows7" DbSelectedDate='<%#Bind("EndDate") %>' />
        <asp:RequiredFieldValidator runat="server" Display="None" ErrorMessage="End Date is required." EnableClientScript="true" ControlToValidate="rdtpEndDate" />
    </td>
</tr>

The ClientEvents-OnDateSelected script looks like this:
<script language="javascript" type="text/javascript">
 
    function dateSelected(sender, args) {
        var hv = document.getElementById('<%=this.hvEndDateId.ClientID %>').value;
        var edp = $find(hv);
        var newDate = sender.get_selectedDate();
        edp.set_minDate(newDate);
    }       
 
</script>

Since it is in a grid I use a hidden field that sets the Id of the end date element when the grid goes into edit mode so when a start date is selected I can set the mininumum date of the end date picker - this whole process works fine.

The problem I am encountering is when you select a date (say 8/31/2011) and select a time (say 7:00 PM) on the start date selector, the end date calendar has 8/31 as an available option, but you can't select it because it defaults to 8/31/2011 12:00:00AM which is before 7:00PM, thus invalid. This makes sense, but how can I make the end date's minimum value detect that it should be 8/31/2011 @ 7:00PM meaning if the end user selects 8/31 it automatically selects 7:00PM for the time? Naturally if they select an end date of 9/1 the default time would still be 12:00AM since that is after 8/31 @ 7:00PM.
Radoslav
Telerik team
 answered on 18 Aug 2011
1 answer
78 views
I have a radgrid with a form template for edits and inserts. In the form template I have a tab control with 3 tabs - 1 of which contains another radgrid. I need to use advanced databinding in the code-behind on the 2nd radgrid but cannot figure out exactly how to wire up the NeedDataSource event.

The 2nd grid is not exposed at design time so I can't put a Handles gdFFP.NeedDataSouce in the code behind.

I also tried to wire the event in the .ascx file using the declarative syntax within the grid definition: OnNeedDataSouce="gdCharges_NeedDataSouce". This compiles but I get an exception at run-time saying the sub does not exist.

Can you point me in the right direction?
Andrey
Telerik team
 answered on 18 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?