ITsolutionWizard
asked on
asp.repeater, duplicate value in rows
Hi Experts,
I have below codes using asp repeater and jdatatable. As you can see it return table UI with column phone, Direction, and message looks like below
Phone No, Direction, Msg
(111)222-1111, Outbound, asdfasdf
(111)222-1111, Inbound, 23423423asdfasdf
(111)222-1111, Outbound, 223434234dfasdf
(222)222-1234, Outbound, 23asdfasjdfasjdfjdfs
(222)222-1234, Inbound, 2131231231312
In the UI, I hope to see. Is it possible?
(111)222-1111, Outbound, asdfasdf
, Inbound, 23423423asdfasdf
, Outbound, 223434234dfasdf
(222)222-1234, Outbound, 23asdfasjdfasjdfjdfs
, Inbound, 2131231231312
I have below codes using asp repeater and jdatatable. As you can see it return table UI with column phone, Direction, and message looks like below
Phone No, Direction, Msg
(111)222-1111, Outbound, asdfasdf
(111)222-1111, Inbound, 23423423asdfasdf
(111)222-1111, Outbound, 223434234dfasdf
(222)222-1234, Outbound, 23asdfasjdfasjdfjdfs
(222)222-1234, Inbound, 2131231231312
In the UI, I hope to see. Is it possible?
(111)222-1111, Outbound, asdfasdf
, Inbound, 23423423asdfasdf
, Outbound, 223434234dfasdf
(222)222-1234, Outbound, 23asdfasjdfasjdfjdfs
, Inbound, 2131231231312
<asp:Repeater runat="server" ID="conversationList" OnItemCommand="conversationList_ItemCommand">
<HeaderTemplate>
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th class="text-center"><small>Phone</small></th>
<th class="text-center"><small>Dir.</small></th>
<th class="text-center"><small>Message/Date Sent</small></th>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr class="odd gradeX">
<td><small><%# ReformatPhoneNo(Eval("To").ToString())%></small></td>
<td><small><%# ReformatDirection(Eval("Direction").ToString()) %></small></td>
<td>
<div class="media">
<div class="media-left">
<%# ReformatHumanIcon(Eval("Direction").ToString()) %>
</div>
<div class="media-body">
<p><small><i style="color:red;"><%# Eval("Body") %></i>
<br /><i>(<%# Eval("DateSent") %>)</i></small>
<asp:LinkButton runat="server" ID="btnReply" CommandName="submitReply" CommandArgument='<%# Eval("To").ToString() + "," + Eval("Body") %>'>
<span aria-hidden="true" class="glyphicon glyphicon-share"></span><small></small>
</asp:LinkButton>
</p>
</div>
</div>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></tbody></table></FooterTemplate>
</asp:Repeater>
private void RetreieveSMSmessage(string accountSid, string authToken)
{
TwilioClient.Init(accountSid, authToken);
var messages = MessageResource.Read();
foreach (var message in messages)
{
// Response.Write(message.Price + " " + message.Status + " " + message.From + " " + message.DateCreated + " " + message.Body + "<br>");
}
conversationList.DataSource = MessageResource.Read();
conversationList.DataBind();
//test.DataSource = messages;
//test.DataBind();
}
ASKER
Great but I just don't know how to merge the codes with my repeater. Thanks
Because i am writing from android device copy the script and change the selectors.Then put thr script at the bottom of the body
ASKER
I copy below script. and nothing is working.
Let me know what else I need to do. Thanks.
Let me know what else I need to do. Thanks.
<script>
(function checkAndSet(){
var firstTdElms=$('#example tr td:first-child');
for(var i=0;i<firstTdElms.length;i++){
var last=firstTdElms[i].innerHTML;
//debugger;
if(last===previous){
firstTdElms[i].innerHTML='--"-- ';
continue;
}
var previous=firstTdElms[i].innerHTML;
}
})();
$(document).ready(function() {
$('#example').dataTable({"bSort": false});
} );
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"Set instead #example the #dataTables-example " - Tried it as well. Still not working.
If you can, just use asp.net repeater and included the jDataTable.
If you can, just use asp.net repeater and included the jDataTable.
Open in new window
For "bsort" option check the documetation in this link