Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
744 views

Hi

I want to validate new records before they gets added to the grid at client-side. After I clear out the "name" field tag I get the red *. Which is perfectly fine and just what I want to do. However, when I click on "Add new record" button more than once, new empty record gets added without being validated.

 

What is the most clean and neat way to achieve this? Below is my code using a classic ASP coding style, so you get everything at one place.

 

01.<%@ Page Language="C#" %>
02. 
03.<!DOCTYPE html>
04. 
05.<html>
06.<head runat="server">
07.  <title>[Title]</title>
08.  <script runat="server">
09.    protected override void OnInit(EventArgs e)
10.    {
11.      this.Load += HandleLoad;
12.      this.PreLoad += HandlePreLoad;
13. 
14.      base.OnInit(e);
15.    }
16.    private void HandleLoad(object sender, EventArgs e)
17.    {
18.      this.grid.DataSource = new[] { new { Id = 1, Name = "Name" } };
19.    }
20.    private void HandlePreLoad(object sender, EventArgs e)
21.    {
22.      this.grid.MasterTableView.AutoGenerateColumns = false;
23.      this.grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
24.      this.grid.MasterTableView.EditMode = GridEditMode.Batch;
25.    }
26.  </script>
27.</head>
28.<body>
29.  <form id="form" runat="server">
30.    <asp:ScriptManager runat="server" />
31.    <div style="width: 25%">
32.      <telerik:RadGrid ID="grid" runat="server">
33.        <MasterTableView>
34.          <Columns>
35.            <telerik:GridTemplateColumn HeaderText="Name">
36.              <EditItemTemplate>
37.                <asp:TextBox ID="name" runat="server" />
38.                <asp:RequiredFieldValidator runat="server" ControlToValidate="name" Text="*" />
39.              </EditItemTemplate>
40.              <ItemTemplate>
41.                <%# Eval("Name") %>
42.              </ItemTemplate>
43.            </telerik:GridTemplateColumn>
44.          </Columns>
45.        </MasterTableView>
46.      </telerik:RadGrid>
47.    </div>
48.  </form>
49.</body>
50.</html>

 

Regrads,

Garmco ICT

Eyup
Telerik team
 answered on 30 Mar 2017
1 answer
167 views

Hi,
I have a scenario where in I have to insert data into multiple tables using a single RadDataForm with EntityDataSource

Following are the three tables and Columns
ComType:  Id, ConType

ContactDetail:  Id, ContactName, City

ContactCom: Id, ContactDetailsId, ComTypeId, ComValue

The point is I am able to insert into single table but not able to insert into multiple tables.

<asp:Label ID="ComValueLabel3" runat="server" AssociatedControlID="ComValueTextBox" CssClass="rdfLabel rdfBlock" Text="ComValue"></asp:Label>
  <telerik:RadTextBox ID="ComValueTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("ComValue") %>' WrapperCssClass="rdfInput" />

 

Following is the syntax of calling other tables columns while insertion
<asp:Label ID="ContactNameLabel2" runat="server" AssociatedControlID="ContactNameTextBox" CssClass="rdfLabel rdfBlock" Text="ContactName"></asp:Label>
 <telerik:RadTextBox ID="ContactNameTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("ContactDetail.ContactName") %>' WrapperCssClass="rdfInput" />

EntityDataSource Code:
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=sampleEntities" DefaultContainerName="sampleEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True"
EntitySetName="ContactComs" EntityTypeFilter="ContactCom" Include="ContactDetail,ComType"></asp:EntityDataSource>

I am unable to call the columns of other tables which are in include method

Here I am attaching the sample DB and full code of my scenario

How can I accomplish this

Thanks In Advance

 

DANA REDDY
Top achievements
Rank 1
 answered on 30 Mar 2017
1 answer
101 views
hi, I have a user control with multiple fields that does its own validation.  What is the best practice when using it inside a Wizard.  It needs to be validated when Next button is clicked, also not sure if validation message can be injected to that if the Wizard
Anoosh
Top achievements
Rank 1
 answered on 30 Mar 2017
0 answers
76 views

I'm finding difficulty getting enough information on the individual parts of controls and data in order to:

1)  Select a single image to upload with RadAsyncUploader

2)  Find the image path that is being uploaded

3)  Display image from selected path using RadBinaryImage

How can I do this?  Can it support Jpg, jpeg, gif, and png?

(Note: I need BinaryImage since data I get from my server can potentially provide a default image in binary array.)

Chris
Top achievements
Rank 1
 asked on 29 Mar 2017
1 answer
92 views

when i build the RadSocialShare dynamically, the RadCompactButton does not work (dialog does not popup with items in the CompactButtons list

 

- working in ASP .net4.5

- No javascript erra's

- I can get to work if i build in markup as described in help documents

- does not work when building the radSocialShare control dynamically

 

<<< Suedo Code >>>

private RadSocialShare CreateRadSocialShareButtons()
{
RadSocialShare radSocialShare = new RadSocialShare();
myList = GetButtonList();  //get my list of social controls items

foreach (ListItem item in myList)
{   //check if button enabled for sharing
if (item.Enabled)
{   //start setting standard properties
RadSocialButton socialButton = new RadSocialButton();
socialButton.SocialNetType = (SocialNetType)Enum.Parse(typeof(SocialNetType), item.SocialNetType);
socialButton.CssClass = "SocialShareButtons";
socialButton.ToolTip = item.SocialSite; //display in tooltip (e.g. Facebook)

if (item.ShowInMain)
{   //display in main list
radSocialShare.MainButtons.Add(socialButton);
}
else
{   //display in compact list
radSocialShare.CompactButtons.Add(socialButton);
}
}
}

if (radSocialShare.CompactButtons.Count > 0)
{ //<!------THIS SHOWS UP ON PAGE, BUT DOES NOTHING---   !>
RadCompactButton radCompactBtn = new RadCompactButton();
radCompactBtn.ToolTip = "See More Social Share Types";
radSocialShare.MainButtons.Add(radCompactBtn);
}
return radSocialShare;
}

Ricardo
Top achievements
Rank 1
 answered on 29 Mar 2017
0 answers
129 views

I have gone through many of the threads in relation to Error Creating Control in the designer, but none of the fixes are working.

I have C# .NET solution with Telerik .dlls in my bin folder, and referenced within the application and in the Solution Explorer.  Also

I have removed them, re-added them, etc.

Here is the key here to my puzzle.........The application works on our OLD Production server where it was sitting.  When I copy the entire

code folder over to the NEW Production server the telerik drop down lists do not populate onselectedindexchange.  It just clears out

all of the data in all the drop downs.  It's very odd and I cannot pin point what is going on.

Any help or suggestions outside of the basics I have done to get the application to work ?  Do I have to install or run some script into the GAC of

the NEW Production Server ?  If so, I have other application running that are working without that which have telerik DLLs in them.

 

I attached the Designer error from Visual Studio

I attached the HTML code showing the Rad Drop Down list

I attached the Main Page LIVE on the Production Server that doesn't work with propagation to the Vendor Drop Down.  again, this works in OLD server, not in NEW....

 

Thanks in advance

 

 

Bryan
Top achievements
Rank 1
 asked on 29 Mar 2017
3 answers
370 views
Hi,

I'm sending you a simple project for demonstrating my questions.

For me login control behaveiur is strange. Some time login page does not shows RadWindow (it contents login control), when i change in web.config Athentication mode from Forms to Windows, and start project, and then restore authentication to Forms, everything is ok, problem disappear for a moment, but after some time appears again.Could you explain me how to fix this 'unstable' behavior.
 

Thank you for your effort answer me

Best regards
Arun
Top achievements
Rank 1
 answered on 29 Mar 2017
0 answers
101 views

Hello all,

I've done ta filter template for a column on my radgrid, i didn't have a problem on that, the problem now is the clear filter button that appears on the others columns doesn't exits, can anybody help ho can i show it again ??

Carlos
Top achievements
Rank 1
 asked on 29 Mar 2017
1 answer
100 views
copy paste in editor not working in Firefox 52.0.2 latest version. can someone help to get it fix?
pragnesh
Top achievements
Rank 1
 answered on 29 Mar 2017
6 answers
189 views
Hi,

I have some recurring appointments in a Radscheduler, I am trying to get an id of an appointment and use it to process some other information.  appt.get_id() returns correct id for parent appointment(3610) or non recurring appointment. However, it returns "parentID_indexOfChildAppointment" (3610_1)for child recurring appointments(with id = 3611).

How do I get exact id of child recurring appointment? I looked into Scheduler api and could not find any property for it.

 //Sets Appointment tooltip position
              function clientBeforeShow(sender, eventArgs) {
                  var height = $telerik.$(sender.get_contentElement())[0].scrollHeight;
                  var width = $telerik.$(sender.get_contentElement())[0].scrollWidth;
                 
                 //Donot send request to webservice if tooltip is null and display subject/default text
                 var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                 if (tooltip == null) {
                     SetToolTipPositionAndText(sender, sender._text);
                     return;
                 }

                  var element = tooltip.get_targetControl();
                  var appt = $find("<%=rsTicketsSchedule.ClientID %>").getAppointmentFromDomElement(element);
                  var apptID = appt.get_id();

Thanks,
Prava
Peter Milchev
Telerik team
 answered on 29 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?