Hi,
How can I set the filename (arguments) that gets sent to the client callback from the ImageEditor?
i.e. from : $find('<%= ImageEditor1.ClientID %>').open('ImageEditor', args, callbackFunction);
On the server side, i couldnt find a SetFileName method...
I tried returning the filename from the StoreBitmap method (just for fun), but it didnt work.
Can you guys please help me on this? thanks in advance.
' build grid
Dim
FieldListList
As
SqlDataReader = kpiSQL.getReader(
"select * from dbo.kpi_QuantityColumn where tableid="
& tableid.ToString)
While
FieldListList.Read
Select
Case
FieldListList(
"fielddataType"
)
Case
6
' is a string column
Dim
boundColumn
As
GridDropDownColumn
boundColumn =
New
GridDropDownColumn()
boundColumn.EmptyListItemText =
"--type or choose--"
' allowcustomtext???
boundColumn.UniqueName = FieldListList(
"FieldName"
)
boundColumn.DataField = FieldListList(
"FieldName"
)
boundColumn.DropDownControlType = GridDropDownColumnControlType.RadComboBox
boundColumn.HeaderText = FieldListList(
"FieldName"
)
boundColumn.HeaderStyle.Wrap =
False
Dim
presetReader
As
SqlDataReader = kpiSQL.getReader(
"SELECT DISTINCT "
& FieldListList(
"FieldName"
) &
" FROM "
& thisTable.dbTableName)
' ???? how do I bind the combo to presetReader?
RadGrid1.MasterTableView.Columns.Add(boundColumn)
Case
Else
' is a numeric column
Dim
boundColumn
As
GridNumericColumn
boundColumn =
New
GridNumericColumn()
RadGrid1.MasterTableView.Columns.Add(boundColumn)
boundColumn.UniqueName = FieldListList(
"FieldName"
)
boundColumn.DataField = FieldListList(
"FieldName"
)
Dim
prefix
As
String
=
""
If
Not
IsDBNull(FieldListList(
"prefix"
))
And
FieldListList(
"FieldName"
) <>
""
Then
prefix =
" ("
& FieldListList(
"prefix"
) &
")"
End
If
boundColumn.HeaderText = FieldListList(
"FieldName"
) + prefix
boundColumn.HeaderStyle.Wrap =
False
boundColumn.DataFormatString =
"{0:N"
& FieldListList(
"NumberOfDps"
) &
"}"
End
Select
End
While
<
td
>
<
telerik:RadComboBox
ID
=
"rcbExamLocation"
Runat
=
"server"
DataSourceID
=
"LinqDataSource1"
DataTextField
=
"LocCity"
DataValueField
=
"LocationID"
Width
=
"250px"
Skin
=
"WebBlue"
OffsetY
=
"0"
ExpandAnimation-Type
=
"Linear"
ExpandAnimation-Duration
=
"150"
>
</
telerik:RadComboBox
>
<
asp:LinqDataSource
ID
=
"LinqDataSource1"
runat
=
"server"
ContextTypeName
=
"SPPExamRegistrationAlphaDataContext"
OrderBy
=
"LocCity, LocAddress"
Select
=
"new (LocCity, LocAddress, LocCounty, LocationID)"
TableName
=
"viewExamLocations"
>
</
asp:LinqDataSource
>
</
td
>
First, I'm using the most recent version of the RadAJAX controls.
I've been trying to set, in the codebehind, the filter control tooltip to the text equivalent of the CurrentFilterFunction that's defined in the markup. I finally came up with a solution but my tooltips were shifted by two columns. It's like there are two "hidden" GridFilterItem cells in that row in the grid.
Here is the markup:
<telerik:RadGrid ID="radgrdMyPrograms" runat="server" Width="100%" DataSourceID="ldsProgramsAllByUserName" EnableLinqExpressions="false"
EnableEmbeddedSkins="false" Skin="DMCpro" ShowStatusBar="true"
AutoGenerateColumns="false" AllowFilteringByColumn="true" AllowPaging="true" AllowSorting="true" PageSize="20" >
<ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" Scrolling-AllowScroll="true" Scrolling-ScrollHeight="600px" Scrolling-UseStaticHeaders="true" />
<MasterTableView TableLayout="Fixed" DataKeyNames="ProgramID,ProgramName,ClientId,Client" >
<HeaderStyle Font-Size="Small" Font-Bold="true" />
<ItemStyle Font-Size="Small" Wrap="false" />
<AlternatingItemStyle Font-Size="Small" Wrap="false" />
<Columns>
<telerik:GridHyperLinkColumn HeaderText="Program #" DataTextField="ProgramID" SortExpression="ProgramID" UniqueName="ProgramID"
HeaderStyle-Width="80px" HeaderStyle-HorizontalAlign="Left"
AllowFiltering="false" />
<telerik:GridBoundColumn HeaderText="Program" DataField="ProgramName" SortExpression="ProgramName"
HeaderStyle-Width="150px" HeaderStyle-HorizontalAlign="Left"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="150px" />
<telerik:GridBoundColumn HeaderText="AE" DataField="AEName" SortExpression="AEName"
HeaderStyle-Width="35px" HeaderStyle-HorizontalAlign="Left"
AllowFiltering="false" />
<telerik:GridBoundColumn HeaderText="Start Date" DataField="StartDate" SortExpression="StartDate"
HeaderStyle-Width="65px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="60px" />
<telerik:GridBoundColumn HeaderText="End Date" DataField="EndDate" SortExpression="EndDate"
HeaderStyle-Width="65px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
CurrentFilterFunction="LessThanOrEqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="60px" />
<telerik:GridBoundColumn HeaderText="Status" DataField="Status" SortExpression="Status"
HeaderStyle-Width="92px" HeaderStyle-HorizontalAlign="Left"
CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="90px" />
<telerik:GridBoundColumn HeaderText="Revenue" DataField="Revenue" SortExpression="Revenue"
HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="Right"
CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
<telerik:GridHyperLinkColumn HeaderText="Client" DataTextField="Client" SortExpression="Client" UniqueName="Client"
HeaderStyle-Width="170px"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="170px" />
<telerik:GridBoundColumn HeaderText="Market" DataField="Market" SortExpression="Market"
HeaderStyle-Width="90px" HeaderStyle-HorizontalAlign="Left"
CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
<telerik:GridBoundColumn HeaderText="Bus. Source" DataField="BusinessSource" SortExpression="BusinessSource"
HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Left"
CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" />
<telerik:GridBoundColumn HeaderText="Pax" DataField="Guests" SortExpression="Guests"
HeaderStyle-Width="45px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Right"
CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" AllowFiltering="false" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
And here is the codebehind:
Private Sub radgrdMyPrograms_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles radgrdMyPrograms.ItemDataBound
If (TypeOf e.Item Is GridDataItem) Then
Dim gdi As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim hlc As HyperLink = DirectCast(gdi.Item("ProgramID").Controls(0), HyperLink)
hlc.NavigateUrl = "~/Programs/Programs.aspx?PNO=" + radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ProgramID").ToString + "&PName=" + Replace(Server.UrlEncode(radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ProgramName")), "'", "")
hlc.CssClass = "info"
Dim hlc2 As HyperLink = DirectCast(gdi.Item("Client").Controls(0), HyperLink)
hlc2.NavigateUrl = "~/Crm/Clients.aspx?ClientId=" + radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("ClientId").ToString + "&ClientName=" + Replace(Server.UrlEncode(radgrdMyPrograms.MasterTableView.DataKeyValues(e.Item.ItemIndex)("Client")), "'", "")
hlc2.CssClass = "info"
ElseIf (TypeOf e.Item Is GridFilteringItem) Then
Dim fi As GridFilteringItem = DirectCast(e.Item, GridFilteringItem)
For i = 0 To radgrdMyPrograms.Columns.Count - 1
fi.Cells(i + 2).ToolTip = radgrdMyPrograms.Columns(i).CurrentFilterFunction.ToString
Next
End If
End Sub
Why do I have to have the (i + 2) in that last statement??
Jerry
function updateTable() {
// "txt" here is the args sent to the "onReceive" function
// set txt value for testing purposes
var txt = 'HB2573';
// get the reference to the RAD grid
var grid = $find("<%=RadGrid1.ClientID %>");
// get the underlying table view
var MasterTable = grid.get_masterTableView();
// get the underlying data source
var items = MasterTable.get_dataItems();
// get the # of rows
var length = MasterTable.get_dataItems().length;
for (var i = 0; i < length; i++) {
// get the record
var record = MasterTable.get_dataItems()[i];
var keyValue = record.getDataKeyValue("fa_MeasureValue")
//alert(keyValue);
if (keyValue == txt) {
var CM = record.findElement("lblCurrentMeasure"); //access the Label control
//alert(CM.innerText);
CM.innerText = "1"; // assigning value to label control
//alert(CM.innerText);
} else {
var CM = record.findElement("lblCurrentMeasure"); //access the Label control
CM.innerText = "0"; // assigning value to label control
}
}
// and rebind it to the changed data
MasterTable.rebind();
}