I having having some issue with the filter of RadGrid.
When i type ‘ the result is showing no data found which is what i wanted.
but if i type something like abc.get(‘abc’); or ‘) OR 1=1 -- the filter textbox get cleared and all result is shown. Would like to check other than this, is there anyway to not clear the filter textbox and for the result to show no data found instead?
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"ContentPlaceHolderBody"
runat
=
"Server"
>
<
script
type
=
"text/javascript"
>
function getvalue()
{
var combo = <%=RadComboBox1.ClientID %>;
alert(combo.SelectedItem);
alert( document.getElementById(combo.UniqueID + "_value").value );
}
</
script
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Item1"
Value
=
"Value1"
/>
<
telerik:RadComboBoxItem
Text
=
"Item2"
Value
=
"Value2"
/>
<
telerik:RadComboBoxItem
Text
=
"Item3"
Value
=
"Value3"
/>
</
Items
>
</
telerik:RadComboBox
>
<
input
id
=
"Button1"
type
=
"button"
value
=
"button"
onclick
=
"getvalue();"
/>
</
asp:Content
>
<
script
>
function rtbClientDebts_ButtonClick(sender, args)
{
var button;
button = args.get_item();
ProcessGridCommand (button.get_commandName());
}
</
script
>
<
telerik:RadToolBar
runat
=
"server"
ID
=
"rtbClientDebts"
Skin
=
"Metro"
Width
=
"100%"
OnClientButtonClicked
=
"rtbClientDebts_ButtonClick"
EnableViewState
=
"false"
>
<
Items
>
<%----- OLD BUTTON -----%>
<
telerik:RadToolBarButton
runat
=
"server"
Text
=
"Add"
CommandName
=
"AddCreditor"
SearchName
=
"AddCreditor"
Enabled
=
"True"
/>
<%----- NEW DESIRED BUTTON -----%>
<
telerik:RadToolBarButton
>
<
ItemTemplate
>
<
telerik:RadButton
runat
=
"server"
Text
=
"Add"
CommandName
=
"AddCreditor"
SearchName
=
"AddCreditor"
Enabled
=
"True"
>
<
Icon
PrimaryIconCssClass
=
"rbAdd"
/>
</
telerik:RadButton
>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
We have a RadCloudUpload control that saves files to an S3 bucket. A postback is done afterwards by a save button. Works fine on dev machines.
On the AWS servers, some files get deleted after upload and save, but not all.
I uploaded 18 files today, 17 of them got deleted after the UncommitedFilesExpirationPeriod (which is set to 1 hour). This was during the day, when we run 16 web servers in a load balanced server group.
I tried later in the evening, when we reduce it to 2 web servers in the group. At that point, I uploaded 18 files again, and 9 were deleted.
That made me suspect that the problem is that the postback is done to a different webserver, and thus the RadUploadControl does not set the files as committed. Does that seem likely? If not, what could be the cause of this?
And more importantly, how should I solve it? I looked in the forum here and found how to override the DeleteFile method, which works... but then how do I allow users to delete files (which seems to work by simply never committing the file and then deleting it from S3 after the UncommitedFilesExpirationPeriod ).
Thanks.
I found this thread but couldn't get the behavior I wanted.
I would like to debounce requests to a WebService method I attached to a RadComboBox.
I am using Lodash and Underscore.js' "debounce" function, but I find that each keypress or even focus on the RadComboBox (perhaps I should set_cancel(true) on focus).
My current setup is:
HTML:
1.
<
telerik:RadComboBox
OnClientItemsRequesting
=
"requesting"
EnableLoadOnDemand
=
"true"
AllowCustomText
=
"true"
ItemRequestTimeout
=
"0"
>
2.
<
WebServiceSettings
Path
=
"Service.asmx"
Method
=
"GetData"
>
3.
</
WebServiceSettings
>
4.
</
telerik:RadComboBox
>
JS:
01.
function
requesting(sender, args) {
02.
let context = args.get_context();
03.
context[
"FilterString"
] = args.get_text();
04.
05.
// Set a delay before requesting items
06.
let debounceTimer = 1000;
07.
08.
// Begin debouncing
09.
_.debounce(setContext, debounceTimer);
10.
}
11.
12.
function
setContext(sender, args) {
13.
var
context = args.get_context();
14.
if
(!sender.prefix)
15.
sender.prefix =
""
;
16.
if
(!window.event || sender.directcall) {
17.
sender.prefix = args.get_text();
18.
}
19.
var
id = sender.get_id();
20.
// Limit minimum character length to 3
21.
if
(sender.prefix.length < 3) {
22.
// Ensure clear is only called when backspacing to an empty value
23.
if
(window.event && window.event.type !=
"click"
) {
24.
clearText();
// Clear results if nothing is typed in
25.
}
26.
args.set_cancel(
true
);
// cancel server call if nothing typed in
27.
return
false
;
28.
}
29.
context[
"prefix"
] = sender.prefix;
30.
return
true
;
31.
}
Is there something I am missing/incorrect in my setup?
The pseudocode I am thinking goes along the lines of:
1. Type at least 3 or more characters in the combo box input
2. Wait 1000ms
3. If another key is entered within 1000ms, reset debounce timer
4. Else proceed call to WebService method
5. Combo box populated
window.OnClientAppointmentsPopulating =
function
(sender, eventArgs) {
var
combobox = $find(
"<%=ddlCatToShow.clientID %>"
);
var
list =
""
;
var
items = combobox.get_items();
var
array = combobox._checkedIndices.toString().split(
','
)
for
(
var
i = 0; i < array.length-1; i++) {
var
item = items.getItem(array[i]);
//alert(item.get_text());
//alert(item.get_value());
list += item.get_value() +
","
;
}
eventArgs.get_schedulerInfo().CategoryList = list.replace(/,\s*$/,
""
);
};
protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) |
{ |
//Get the GridEditableItem of the RadGrid |
GridEditableItem editedItem = e.Item as GridEditableItem; |
//Get the Primary Key associated with the edited row |
//Get the Control Values for the associated rows |
//Insert and update soem information in the database |
} |
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem && e.Item.OwnerTableView.DataSourceID == "SQLDataSourceParent") |
{ |
//Get the GridEditableItem of the RadGrid |
GridDataItem dataItem = e.Item as GridDataItem; |
//Get the primary key value of the row using the DataKeyValue. |
//Set the Template Column values based on database records |
} |
} |
I have a product in asp.net web forms which has 6000+ plus clients with differant databases.
I stored raddock state of user controls in database. now i want to convert my application to mvc. so now how could i load this state in mvc . user controls treated as partial view
So here is the button code
<div class="row mb-3">
<div class="col-lg-6">
<div class="form-inline">
<telerik:RadButton ID="btnRunAudits" runat="server" SingleClick="true" OnClick="btnRunAudits_Click" CssClass="btn btn-info mr-3">
<ContentTemplate>
<i class="fal fa-long-arrow-right"></i>Execute System Edits
</ContentTemplate>
</telerik:RadButton>
<telerik:RadLabel ID="lblExecuteAuditHistory" runat="server" CssClass="time-stamp" Visible="false"></telerik:RadLabel>
</div>
</div>
<div class="col-lg-6 text-right">
<telerik:RadButton ID="btnExport" runat="server" OnClientClicking="btnExport_onClientClicking" OnClick="btnExport_Click" CssClass="btn btn-info">
<ContentTemplate>
<i class="fal fa-file-export"></i>Export Option(s)
</ContentTemplate>
</telerik:RadButton>
<telerik:RadButton ID="btnRefreshErrors" runat="server" OnClick="btnRefreshErrors_Click" CssClass="btn btn-refresh" SingleClick="true" Width="100">
<ContentTemplate>
<i class="far fa-sync"></i> Refresh
</ContentTemplate>
</telerik:RadButton>
</div>
</div>
Here is what normally works but does not:
protected void btnRunAudits_Click(object sender, EventArgs e)
{
// CLF - the button should be disabled if you can't click. But just in case!
if (util.Db.GetUBUserAssign(ubid) == util.appUserId && IsValidEdit(util.Db.GetUBStatusByUBID(ubid).ToString()))
{
btnExport.Enabled = false; <==========
btnRefreshErrors.Enabled = false; <=========
//util.Db.RunUBAuditsBC(ubid);
BuildExceptionGrid();
if (gItemizedParsing.Items.Count > 0)
{
plcTraining.Visible = true;
}
else
{
Session["UBAuditOpen" + ubid.ToString()] = "T";
Response.Redirect("~/ubEditor.aspx?SysID=" + ubid.ToString(), false);
}
//add entry into audit history table
util.Db.SaveLastExecuteInfo(ubid, util.appUserId);
lbItemsRemaining.Text = util.Db.GetPotentialItemsRemaining(ubid);
DataTable dt = util.Db.GetLastExecuteInfo(ubid);
if (dt.Rows.Count > 0)
{
lblExecuteAuditHistory.Visible = true;
lblExecuteAuditHistory.Text = "Last Executed by " + dt.Rows[0]["displayNm"].ToString() + " at " + dt.Rows[0]["dateup"].ToString();
}
btnExport.Visible = true;
btnRefreshErrors.Visible = true;
}
else
{
btnRunAudits.Enabled = false;
}
}
I have verified it is hitting the code above noted with <========
Basically when they press the btnRunAudits button i want btnExport and btnRefreshErrors disabled until btnRunAudits is done.
HELP :)
I have a RadGrid that I want to show a Font Awesome icon as a button. The column is set as a GridButtonColumn ButtonType="FontIconButton" with the button css class set. When the CommandName is blank the icon shows. When I assign the value CommandName="GetvCard" the grid shows the text "GetvCard" and not the icon. I don't have any code attached to the button yet as I was testing the UI only. Full grid markup:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" DataSourceID="ObjectDataSource1" AllowFilteringByColumn="true" EnableLinqExpressions="false">
<MasterTableView AutoGenerateColumns="False" DataSourceID="ObjectDataSource1">
<Columns>
<telerik:GridButtonColumn ButtonType="FontIconButton" ButtonCssClass="fad fa-address-card xgrid blue" CommandName="GetvCard" UniqueName="GetvCard" CommandArgument="GetvCard">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="MYNAME" FilterControlAltText="Filter MYNAME column" HeaderText="Name" ReadOnly="True" SortExpression="MYNAME" UniqueName="MYNAME">
<FilterTemplate>
<telerik:RadTextBox ID="RadTextBox1" runat="server" ClientEvents-OnBlur="NameSearch" EmptyMessage="Name Search"></telerik:RadTextBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function NameSearch(sender, args) {
var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
var mystring = sender.get_value();
tableView.filter("MYNAME", mystring, "Contains");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DSCRIPTN" AllowFiltering="false" FilterControlAltText="Filter DSCRIPTN column" HeaderText="Title" SortExpression="DSCRIPTN" UniqueName="DSCRIPTN">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="EXTENSION" AllowFiltering="false" FilterControlAltText="Filter EXTENSION column" HeaderText="Extension" ReadOnly="True" SortExpression="EXTENSION" UniqueName="EXTENSION">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="CELLNO" AllowFiltering="false" FilterControlAltText="Filter CELLNO column" HeaderText="Mobile No." ReadOnly="True" SortExpression="CELLNO" UniqueName="CELLNO">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="INET1" AllowFiltering="false" FilterControlAltText="Filter INET1 column" HeaderText="Email" SortExpression="INET1" UniqueName="INET1">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Am I missing something?
Scott