I am having a tilelist with the following settings:
And in the code behind:
When I first load the page and selected some tiles and click on the fetch button for the first time, I can get all the the tiles that have been selected and delete those records from DB.
The problem is, after that, if I select some of other tiles, and click fetch button, the selected tiles are not recognized any more, and hence I couldn't delete them from DB.
I suspect the postdata in the post back request is different from the data stored in ViewState, thus making the selection changed event not fired. I tried to call the LoadList() method at Page_Init() and Page_Onload bit they seemed not working.
Is there any wrong understanding ? And how do I resolve the above problem?
Thank you very much
*Note: Some of the irrelevant codes are removed from the above code snippet.
<
telerik:RadTileList
runat
=
"server"
ID
=
"RadTileList1"
AppendDataBoundItems
=
"true"
SelectionMode
=
"Multiple"
TileRows
=
"1"
Height
=
"100px"
Width
=
"980px"
ScrollingMode
=
"None"
<
DataBindings
>
<
CommonTileBinding
TileType
=
"RadImageAndTextTile"
DataGroupNameField
=
"TOOL"
/>
<
ImageAndTextTileBinding
DataTextField
=
"LOT_ID"
/>
<
TilePeekTemplate
>
<
div
class
=
"peekTemplateClass"
>
<
strong
>Product:</
strong
>
<%#DataBinder.Eval(Container.DataItem, "PRODUCT")%>
<
br
/>
</
div
>
</
TilePeekTemplate
>
</
DataBindings
>
<
Groups
>
<
telerik:TileGroup
Name
=
"24575"
>
<
telerik:RadContentTemplateTile
ID
=
"RadContentTemplateTile27"
runat
=
"server"
CssClass
=
"noHover"
Height
=
"75px"
>
<
ContentTemplate
>
<
div
class
=
"innerTitle"
>
<
strong
>24575</
strong
>
</
div
>
</
ContentTemplate
>
</
telerik:RadContentTemplateTile
>
</
telerik:TileGroup
>
</
Groups
>
</
telerik:RadTileList
>
And in the code behind:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
using
System.Data;
public
partial
class
StockerViewMonitor : System.Web.UI.Page
{
protected
override
void
OnInit(EventArgs e)
{
base
.OnInit(e);
FcDAL.SetupOracleDBConnection(Helper.GetScConnStr());
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
LoadList();
}
protected
void
fetchButton_OnClick(
object
sender, EventArgs e)
{
List<RadBaseTile> selectedTiles = RadTileList1.GetSelectedTiles()
DbCommand[] deleteCmds =
new
DbCommand[selectedTiles.Count];
int
j = 0;
foreach
(RadBaseTile tile
in
selectedTiles)
{
deleteCmds[j] = FcDAL.CreateDbCommand(
"DELETE A_GF_TOOL_LOT WHERE LOT_ID=:0"
, ((RadImageAndTextTile)tile).Text);
j++;
}
FcDAL.ExecuteTransaction(deleteCmds);
LoadList();
}
private
DataTable GetLotList(
int
toolID)
{
// Get retRetable
return
retTable;
}
private
void
LoadList()
{
RadTileList1.DataSource = GetLotList(24575);
RadTileList1.DataBind();
}
}
}
When I first load the page and selected some tiles and click on the fetch button for the first time, I can get all the the tiles that have been selected and delete those records from DB.
The problem is, after that, if I select some of other tiles, and click fetch button, the selected tiles are not recognized any more, and hence I couldn't delete them from DB.
I suspect the postdata in the post back request is different from the data stored in ViewState, thus making the selection changed event not fired. I tried to call the LoadList() method at Page_Init() and Page_Onload bit they seemed not working.
Is there any wrong understanding ? And how do I resolve the above problem?
Thank you very much
*Note: Some of the irrelevant codes are removed from the above code snippet.