elsit jose

elsit jose

  • 2.1k
  • 7
  • 2.2k

how will i covert to jquery

Mar 26 2015 7:03 AM
if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach (TableCell cell in e.Row.Cells)
{
string s = cell.Text;
if (cell.Text.Length > 10)
cell.Text = cell.Text.Substring(0, 10) + "....";
cell.ToolTip = s;
this should be converted to jquery and my page is.. 
<body>
<form id="form1" runat="server">
<div class="limitChar">
<asp:GridView ID="grdStudentList" runat="server" AutoGenerateColumns="false" >
<Columns>
<asp:BoundField DataField="studentID" HeaderText="studentID" ReadOnly="True" />
<asp:BoundField DataField="studentName" HeaderText="studentName" />
<asp:BoundField DataField="Address" HeaderText="Address" />
<asp:BoundField DataField="Country" HeaderText="Country" />
<asp:BoundField DataField="City" HeaderText="City" />
<asp:BoundField DataField="Description" HeaderText="Description" />
<asp:BoundField DataField="Pincode" HeaderText="Pincode" />
</Columns>
</asp:GridView>
</div>
</form>
<script src="script/jquery-1.9.1.js" type="text/javascript"></script>
<script src="script/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
alert();
$(".limitChar").each(function() {

alert("gjhghj");
$cell.text();
alert($(BoundField).val);
alert(DataField.val.length);
if (BoundField.value.length > 10) {
$(this).text($(this).text().substr(0, 10) + '...');
}

});
});
</script>

how to convert using jquery css tooltip function to limit the character.
 

Answers (1)